NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

Available endpoints:

(4.1)

From 7,265 users

3,500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
231ms263ms290ms609ms906ms

Didn't find what you were looking for? Suggest an improvement


/v1/stockexchange GET

https://api.api-ninjas.com/v1/stockexchange

Returns detailed information about stock exchanges matching the specified criteria. At least one parameter is required.

To get a list of all available stock exchanges, use the /v1/allstockexchanges endpoint.

Parameters

  • mic  optional

    Market Identifier Code (e.g., XNYS).

  • name  optional

    Stock exchange name (supports partial matching).

  • city  optional

    City where the exchange is located.

  • country  optional

    2-letter country code (ISO-3166-1 alpha-2) (e.g., US).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • mic

    Market Identifier Code (e.g., XNYS).

  • name

    Stock exchange name.

  • city

    City where the exchange is located.

  • country

    Country code in ISO2 format (e.g., US).

  • iso2

    ISO2 country code.

  • description

    Description of the stock exchange.

  • address

    Physical address of the stock exchange.

  • website

    Official website of the stock exchange.

  • founded

    Date of establishment in YYYY-MM-DD format.

  • num_listings

    Number of listings on the stock exchange.

  • market_cap_usd

    Market capitalization in USD.

  • currency

    Currency used for market capitalization.

  • timezone

    Timezone of the stock exchange.

  • market_open  Business and Professional tier only

    Opening time of the stock exchange.

  • market_close  Business and Professional tier only

    Closing time of the stock exchange.

  • is_market_open  Business and Professional tier only

    Whether the exchange is currently open for trading at the time of the request.

  • closed_reason  Business and Professional tier only

    Reason the exchange is closed (e.g., Weekend, Holiday - Christmas Day, Early Close - Day After Thanksgiving, Outside Regular Trading Hours). null if the exchange is currently open.

Sample Request Live Demo!

mic
name
city
country

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/stockexchange?mic=XNYS

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      mic:"XNYS",
      name:"New York Stock Exchange",
      city:"New York City",
      country:"United States",
      iso2:"US",
      description:"The largest stock exchange in the world by market capitalization, facilitating trading in a wide range of securities.",
      address:"11 Wall Street, New York, NY 10005, USA",
      website:"https://www.nyse.com",
      founded:"1792-05-17",
      num_listings:2223,
      market_cap_usd:28330000000000,
      currency:"USD",
      timezone:"America/New_York",
      market_open:"09:30",
      market_close:"16:00",
      is_market_open:true,
      closed_reason:null
    }
]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/stockexchange?mic=XNYS&country=US" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.


/v1/allstockexchanges GETBusiness and Professional tier only

https://api.api-ninjas.com/v1/allstockexchanges

Returns a list of all available stock exchanges and their details.

Parameters

This endpoint does not accept any parameters.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the same fields as the /v1/stockexchange response, or an error if the request is unsuccessful.

Sample Request Live Demo!

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/allstockexchanges

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      mic:"XASX",
      name:"Australian Securities Exchange",
      city:"Sydney",
      country:"Australia",
      iso2:"AU",
      description:"The primary securities exchange in Australia, offering a range of services including listings, trading, clearing, and settlement.",
      address:"20 Bridge Street, Sydney NSW 2000, Australia",
      website:"https://www.asx.com.au",
      founded:"1987-04-01",
      num_listings:2187,
      market_cap:1868081480000,
      currency:"AUD",
      timezone:"Australia/Sydney",
      market_open:"10:00",
      market_close:"16:00",
      is_market_open:false,
      closed_reason:"Outside Regular Trading Hours"
    },
    {
      mic:"XNYS",
      name:"New York Stock Exchange",
      city:"New York City",
      country:"United States",
      iso2:"US",
      description:"The largest stock exchange in the world by market capitalization, facilitating trading in a wide range of securities.",
      address:"11 Wall Street, New York, NY 10005, USA",
      website:"https://www.nyse.com",
      founded:"1792-05-17",
      num_listings:2223,
      market_cap_usd:28330000000000,
      currency:"USD",
      timezone:"America/New_York",
      market_open:"09:30",
      market_close:"16:00",
      is_market_open:true,
      closed_reason:null
    },
    "..."
]

/v1/stockexchangehours GETBusiness and Professional tier only

https://api.api-ninjas.com/v1/stockexchangehours

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.

Parameters

  • date  optional

    Date in yyyy-mm-dd format. Returns whether exchanges are open on that date and the trading hours. Must not be combined with timestamp.

  • timestamp  optional

    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.

  • mic  optional

    Market Identifier Code (e.g., XNYS). If not set, returns data for all exchanges.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • mic

    Market Identifier Code.

  • name

    Stock exchange name.

  • is_open

    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

    Reason the exchange is closed (e.g., Weekend, Holiday - Christmas Day, Early Close - Day After Thanksgiving, Outside Regular Trading Hours). null if the exchange is open.

  • market_open

    Opening time of the exchange on that date.

  • market_close

    Closing time of the exchange on that date. Adjusted for early closures on holidays.

  • holiday

    Name of the holiday, if the date falls on one. Only present on holiday dates.

Sample Request Live Demo!

date
timestamp
mic

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/stockexchangehours?date=2026-12-25&mic=XNYS

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      mic:"XNYS",
      name:"New York Stock Exchange",
      is_open:false,
      closed_reason:"Holiday - Christmas Day",
      market_open:"09:30",
      market_close:"16:00",
      holiday:"Christmas Day"
    }
]

/v1/stockexchangeholidays GETBusiness and Professional tier only

https://api.api-ninjas.com/v1/stockexchangeholidays

Returns holiday calendars for stock exchanges, including full closures and early close days. If no parameters are specified, returns holidays for all exchanges. Only confirmed future holidays are included — additional holidays will be added as they are officially confirmed by each exchange.

Parameters

  • mic  optional

    Market Identifier Code (e.g., XNYS). Filters results to a specific exchange.

  • name  optional

    Stock exchange name (supports partial matching).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • mic

    Market Identifier Code.

  • name

    Stock exchange name.

  • country

    Country of the exchange.

  • timezone

    Timezone of the exchange.

  • holidays

    Array of holiday objects. Each contains: date (yyyy-mm-dd), name (holiday name), type (full_close or early_close), confirmed (boolean), and optionally early_close_time (local time).

Sample Request Live Demo!

mic
name

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/stockexchangeholidays?mic=XNYS

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      mic:"XNYS",
      name:"New York Stock Exchange",
      country:"United States",
      timezone:"America/New_York",
      holidays:[
        {
          date:"2026-01-01",
          name:"New Year's Day",
          type:"full_close",
          confirmed:true
        },
        {
          date:"2026-01-19",
          name:"Martin Luther King Jr. Day",
          type:"full_close",
          confirmed:true
        },
        {
          date:"2026-11-27",
          name:"Day After Thanksgiving",
          type:"early_close",
          confirmed:true,
          early_close_time:"13:00"
        },
        "..."
      ]
    }
]

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Stock Exchange API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • It provides key details on over 100 markets worldwide, including each exchange's name, city, country, address, website, founded date, num_listings, market_cap_usd, currency, and timezone. To look up prices or company symbols on these exchanges, pair it with the Stock Price API or the Ticker API.
  • At least one parameter is required: you can filter by mic (Market Identifier Code, e.g. XNYS), name (supports partial matching), city, or country (ISO-3166-1 alpha-2 code, e.g. US). To retrieve every exchange at once instead, use the /v1/allstockexchanges endpoint, which is available on Business and Professional tiers (see pricing).
  • Use the /v1/stockexchangehours endpoint with either a date (yyyy-mm-dd) or a Unix timestamp in seconds (the two cannot be combined), optionally narrowing to one exchange with mic; the response returns is_open, closed_reason, and holiday-adjusted market_open and market_close times. This endpoint requires a Business or Professional plan, which you can review on the pricing page.
  • Yes. The /v1/stockexchangeholidays endpoint returns a holidays array for each exchange, where every entry includes date, name, type (full_close or early_close), confirmed, and an optional early_close_time; only confirmed future holidays are returned, with more added as exchanges officially confirm them. If a request returns an unexpected result, check the error codes reference.