api-ninjas-com Stock Exchange API

The Stock Exchange API provides comprehensive information about over 100 markets around the world, including trading hours, location details, and number of listings.

Operations 4

GET /v1/stockexchange Get stock exchange information #
GET /v1/allstockexchanges Get all stock exchanges (Business and Professional tier only) #
GET /v1/stockexchangehours Check stock exchange hours and open/closed status (Business and Professional… #
GET /v1/stockexchangeholidays Get stock exchange holiday calendars (Business and Professional tier only) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-stock-exchange-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-stock-exchange-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Stock Exchange API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Stock Exchange
  description: The Stock Exchange API provides comprehensive information about over 100 markets around the world, including trading hours, location details, and number of listings.
paths:
  /v1/stockexchange:
    get:
      summary: Get stock exchange information
      description: Returns stock exchange details matching a MIC, name, city, or country, including trading hours and number of listings. For every exchange use /allstockexchanges.
      operationId: getStockExchange
      security:
      - ApiKeyAuth: []
      parameters:
      - name: mic
        in: query
        description: Market Identifier Code (e.g., XNYS).
        required: false
        schema:
          type: string
      - name: name
        in: query
        description: Stock exchange name (supports partial matching).
        required: false
        schema:
          type: string
      - name: city
        in: query
        description: City where the exchange is located.
        required: false
        schema:
          type: string
      - name: country
        in: query
        description: Country code in ISO2 format (e.g., US).
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StockExchange'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      tags:
      - Stock Exchange
  /v1/allstockexchanges:
    get:
      summary: Get all stock exchanges (Business and Professional tier only)
      description: Returns every supported stock exchange in one call. To look up one exchange by MIC, name, city, or country use /stockexchange. Business and Professional tiers only.
      operationId: getAllStockExchanges
      security:
      - ApiKeyAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StockExchange'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Business or Professional tier required
        '500':
          description: Internal Server Error
      tags:
      - Stock Exchange
  /v1/stockexchangehours:
    get:
      summary: Check stock exchange hours and open/closed status (Business and Professional…
      operationId: getStockExchangeHours
      description: Check if stock exchanges are open on a specific date or at a specific point in time. Returns trading hours (adjusted for early closures and holidays) and open/closed status.
      security:
      - ApiKeyAuth: []
      parameters:
      - name: date
        in: query
        description: Date in yyyy-mm-dd format. Returns whether exchanges are open on that date and the trading hours. Must not be combined with timestamp.
        required: false
        schema:
          type: string
          format: date
      - name: timestamp
        in: query
        description: Unix timestamp in seconds. Returns whether exchanges are open at that exact moment in time and the trading hours. Must not be combined with date.
        required: false
        schema:
          type: integer
      - name: mic
        in: query
        description: Market Identifier Code (e.g., XNYS). If not set, returns data for all exchanges.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExchangeStatus'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Business or Professional tier required
        '500':
          description: Internal Server Error
      tags:
      - Stock Exchange
  /v1/stockexchangeholidays:
    get:
      summary: Get stock exchange holiday calendars (Business and Professional tier only)
      operationId: getStockExchangeHolidays
      description: Returns holiday calendars for stock exchanges, including full closures and early close days. If no parameters are specified, returns holidays for all exchanges.
      security:
      - ApiKeyAuth: []
      parameters:
      - name: mic
        in: query
        description: Market Identifier Code (e.g., XNYS). Filters results to a specific exchange.
        required: false
        schema:
          type: string
      - name: name
        in: query
        description: Stock exchange name (supports partial matching).
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExchangeHolidays'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Business or Professional tier required
        '500':
          description: Internal Server Error
      tags:
      - Stock Exchange
components:
  schemas:
    StockExchange:
      type: object
      properties:
        mic:
          type: string
          description: Market Identifier Code (e.g., XNYS).
        name:
          type: string
          description: Stock exchange name.
        city:
          type: string
          description: City where the exchange is located.
        country:
          type: string
          description: Country code in ISO2 format (e.g., US).
        iso2:
          type: string
          description: ISO2 country code.
        description:
          type: string
          description: Description of the stock exchange.
        address:
          type: string
          description: Physical address of the stock exchange.
        website:
          type: string
          description: Official website of the stock exchange.
          format: uri
        founded:
          type: string
          description: Date of establishment in YYYY-MM-DD format.
          format: date
        num_listings:
          type: integer
          description: Number of listings on the stock exchange.
        market_cap_usd:
          type: number
          description: Market capitalization in USD.
        market_cap:
          type: number
          description: Total market capitalization in the local trading currency.
        currency:
          type: string
          description: Currency used for market capitalization.
        timezone:
          type: string
          description: Timezone of the stock exchange.
        market_open:
          type: string
          description: Opening time of the stock exchange. Business and Professional tier only.
        market_close:
          type: string
          description: Closing time of the stock exchange. Business and Professional tier only.
        is_market_open:
          type:
          - boolean
          - 'null'
          description: Whether the exchange is currently open for trading. Business and Professional tier only.
        closed_reason:
          type:
          - string
          - 'null'
          description: Reason the exchange is closed (e.g., Weekend, Holiday - Christmas Day, Early Close - Day After Thanksgiving, Outside Regular Trading Hours). Business and Professional tier only.
    ExchangeStatus:
      type: object
      properties:
        mic:
          type: string
          description: Market Identifier Code.
        name:
          type: string
          description: Stock exchange name.
        is_open:
          type:
          - boolean
          - 'null'
          description: Whether the exchange is open. When using date, indicates if the exchange trades at all that day. When using timestamp, indicates if the exchange is open at that exact moment.
        closed_reason:
          type:
          - string
          - 'null'
          description: Reason the exchange is closed (e.g., Weekend, Holiday - Christmas Day, Early Close - Day After Thanksgiving, Outside Regular Trading Hours).
        market_open:
          type: string
          description: Opening time of the exchange on that date.
        market_close:
          type: string
          description: Closing time of the exchange on that date. Adjusted for early closures on holidays.
        holiday:
          type: string
          description: Name of the holiday, if the date falls on one. Only present on holiday dates.
    ExchangeHolidays:
      type: object
      properties:
        mic:
          type: string
          description: Market Identifier Code.
        name:
          type: string
          description: Stock exchange name.
        country:
          type: string
          description: Country of the exchange.
        timezone:
          type: string
          description: Timezone of the exchange.
        holidays:
          type: array
          description: Array of holiday objects for the exchange.
          items:
            type: object
            properties:
              date:
                type: string
                format: date
                description: Holiday date in yyyy-mm-dd format.
              name:
                type: string
                description: Holiday name.
              type:
                type: string
                enum:
                - full_close
                - early_close
                description: 'Type of closure: full_close or early_close.'
              confirmed:
                type: boolean
                description: Whether the holiday date has been officially confirmed.
              early_close_time:
                type: string
                description: Local closing time for early close days.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api