The Stock Exchange API provides comprehensive information about over 100 markets around the world, including trading hours, location details, and number of listings.
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.
mic
optionalMarket Identifier Code (e.g., XNYS
).
name
optionalStock exchange name (supports partial matching).
city
optionalCity where the exchange is located.
country
optionalCountry code in ISO2 format (e.g., US
).
X-Api-Key
requiredAPI Key associated with your account.
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
Opening time of the stock exchange.
market_close
Closing time of the stock exchange.
https://api.api-ninjas.com/v1/stockexchange?mic=XNYS
Headers
X-Api-Key
Log in or sign up to get your API Key
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"
}
]
1
2
3
4
5
6
7
import requests
api_url = 'https://api.api-ninjas.com/v1/stockexchange?mic=XNYS&country=US'
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
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.
https://api.api-ninjas.com/v1/allstockexchanges
Returns a list of all available stock exchanges and their details.
This endpoint does not accept any parameters.
X-Api-Key
requiredAPI Key associated with your account.
Returns a list of all available stock exchanges and their details. The format is the same as the /v1/stockexchange endpoint.
1
https://api.api-ninjas.com/v1/allstockexchanges
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"
},
"..."
]