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:
- /v1/stockexchange - Get detailed information about stock exchanges matching the specified criteria
- /v1/allstockexchanges - Get a list of all available stock exchanges and their details
- /v1/stockexchangehours - Check if stock exchanges are open on a specific date or at a specific time
- /v1/stockexchangeholidays - Get holiday calendars for stock exchanges
From 7,265 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 253ms | 279ms | 294ms | 553ms | 1166ms |
Similar APIs
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
micoptionalMarket Identifier Code (e.g.,
XNYS).nameoptionalStock exchange name (supports partial matching).
cityoptionalCity where the exchange is located.
countryoptional2-letter country code (ISO-3166-1 alpha-2) (e.g.,
US).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
micMarket Identifier Code (e.g.,
XNYS).nameStock exchange name.
cityCity where the exchange is located.
countryCountry code in ISO2 format (e.g.,
US).iso2ISO2 country code.
descriptionDescription of the stock exchange.
addressPhysical address of the stock exchange.
websiteOfficial website of the stock exchange.
foundedDate of establishment in
YYYY-MM-DDformat.num_listingsNumber of listings on the stock exchange.
market_cap_usdMarket capitalization in USD.
currencyCurrency used for market capitalization.
timezoneTimezone of the stock exchange.
market_openBusiness and Professional tier onlyOpening time of the stock exchange.
market_closeBusiness and Professional tier onlyClosing time of the stock exchange.
is_market_openBusiness and Professional tier onlyWhether the exchange is currently open for trading at the time of the request.
closed_reasonBusiness and Professional tier onlyReason the exchange is closed (e.g.,
Weekend,Holiday - Christmas Day,Early Close - Day After Thanksgiving,Outside Regular Trading Hours).nullif the exchange is currently open.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/stockexchange?mic=XNYSHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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-KeyrequiredAPI 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/allstockexchangesHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
/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
dateoptionalDate in
yyyy-mm-ddformat. Returns whether exchanges are open on that date and the trading hours. Must not be combined withtimestamp.timestampoptionalUnix timestamp in seconds. Returns whether exchanges are open at that exact moment in time and the trading hours. Must not be combined with
date.micoptionalMarket Identifier Code (e.g.,
XNYS). If not set, returns data for all exchanges.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
micMarket Identifier Code.
nameStock exchange name.
is_openWhether the exchange is open. When using
date, indicates if the exchange trades at all that day. When usingtimestamp, indicates if the exchange is open at that exact moment.closed_reasonReason the exchange is closed (e.g.,
Weekend,Holiday - Christmas Day,Early Close - Day After Thanksgiving,Outside Regular Trading Hours).nullif the exchange is open.market_openOpening time of the exchange on that date.
market_closeClosing time of the exchange on that date. Adjusted for early closures on holidays.
holidayName of the holiday, if the date falls on one. Only present on holiday dates.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/stockexchangehours?date=2026-12-25&mic=XNYSHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
/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
micoptionalMarket Identifier Code (e.g.,
XNYS). Filters results to a specific exchange.nameoptionalStock exchange name (supports partial matching).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
micMarket Identifier Code.
nameStock exchange name.
countryCountry of the exchange.
timezoneTimezone of the exchange.
holidaysArray of holiday objects. Each contains:
date(yyyy-mm-dd),name(holiday name),type(full_closeorearly_close),confirmed(boolean), and optionallyearly_close_time(local time).
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/stockexchangeholidays?mic=XNYSHeaders
X-Api-KeyLog in or sign up to get your API Key