
Everything you need to do in order to migrate from Marketstack API version 1 to version 2.
Obtain the list of Tickers.
Marketstack v1:In your current version v1, if you need to get the list of tickers supported by Marketstack API, you have to make an API call to tickers
endpoint and then map through the data object to get the names
or symbols
only.
GET https://api.marketstack.com/v1/tickers?access_key=YOUR_ACCESS_KEY
Marketstack v2:
We have got a new endpoint called List of Tickers
that will get you a list of tickers available. A smaller JSON response will save your bandwidth and you can expect a faster response.
Note: You can still use the tickers
endpoint to obtain the list of tickers but that’s not the ideal way to do that as we have now a new endpoint for that in version 2.
1 |
GET https://api.marketstack.com/v1/tickers?access_key=YOUR_ACCESS_KEY |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
"data": [ { "ticker": "A" }, { "ticker": "AA" }, { "ticker": "AAAP" }, { "ticker": "AABA" }, { "ticker": "AACAY" },... |
Market Indices
In version 1, to access index data, simply pass INDX as your stock exchange MIC identification, as seen in the examples below. The example API request below illustrates how to obtain end-of-day data for the DJI market index.
1 |
GET https://api.marketstack.com/v1/eod?access_key=YOUR_ACCESS_KEY&symbols=DJI.INDX |
Version 2:
We have got a new endpoint called indexlist
which will return the full list of supported benchmarks/indexes.
1 |
http://api.marketstack.com/v2/indexlist?access_key=[API_KEY] |
Response:
1 2 3 4 5 6 7 |
{ "region": "america", "country": "united states", "benchmark": "us500", "price": "5425.33", "price_change_day": "50.01", ... |
You can pass the index in the index
required parameter in order to get the details of any particular index.
1 |
GET http://api.marketstack.com/v1/indexinfo?access_key=[API_KEY]&index=us500 |