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 |
|---|---|---|---|---|
| 231ms | 263ms | 290ms | 609ms | 906ms |
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 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=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?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-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 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/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 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=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 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=XNYSHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Frequently Asked Questions
Can I use the Stock Exchange API for commercial purposes?
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.How do I get an API key and start using the Stock Exchange API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Stock Exchange API fails?
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.What data and coverage does the Stock Exchange API provide?
It provides key details on over 100 markets worldwide, including each exchange'sname,city,country,address,website,foundeddate,num_listings,market_cap_usd,currency, andtimezone. To look up prices or company symbols on these exchanges, pair it with the Stock Price API or the Ticker API.How do I query a specific stock exchange on the /v1/stockexchange endpoint?
At least one parameter is required: you can filter bymic(Market Identifier Code, e.g.XNYS),name(supports partial matching),city, orcountry(ISO-3166-1 alpha-2 code, e.g.US). To retrieve every exchange at once instead, use the/v1/allstockexchangesendpoint, which is available on Business and Professional tiers (see pricing).How can I tell whether an exchange is open on a given date or time?
Use the/v1/stockexchangehoursendpoint with either adate(yyyy-mm-dd) or a Unixtimestampin seconds (the two cannot be combined), optionally narrowing to one exchange withmic; the response returnsis_open,closed_reason, and holiday-adjustedmarket_openandmarket_closetimes. This endpoint requires a Business or Professional plan, which you can review on the pricing page.Does the API include stock exchange holiday calendars?
Yes. The/v1/stockexchangeholidaysendpoint returns aholidaysarray for each exchange, where every entry includesdate,name,type(full_closeorearly_close),confirmed, and an optionalearly_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.