Save over 30% when you subscribe to an annual subscription plan!

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.

/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

    Country code in ISO2 format (e.g., US).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

  • 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.

Sample Request Live Demo!

mic
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
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 GETDeveloper and Business 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

Returns a list of all available stock exchanges and their details. The format is the same as the /v1/stockexchange endpoint.

Sample Request

1 https://api.api-ninjas.com/v1/allstockexchanges
JSON
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" }, "..." ]