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
253ms279ms294ms553ms1166ms

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 this API endpoint with all available parameters in our API playground

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

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/stockexchange?symbol=^GSPC" \ -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 this API endpoint with all available parameters in our API playground

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

Headers

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

Sample Response

JSON

/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 this API endpoint with all available parameters in our API playground

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

/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 this API endpoint with all available parameters in our API playground

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