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
API Status
/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
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_openOpening time of the stock exchange.
market_closeClosing time of the stock exchange.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/stockexchange?mic=XNYSHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[
{
"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"
}
]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
Returns a list of all available stock exchanges and their details. The format is the same as the /v1/stockexchange endpoint.
Sample Request
https://api.api-ninjas.com/v1/allstockexchangesSample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[
{
"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"
},
{
"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"
},
"..."
]