Search code examples
apigetstock

MarketStack API Only Returns IEXG Exchange Data


I'm using the Marketstack API and I want to return intradata data for symbols on the Nasdaq. The Nasdaq has a MIC of XNAS. The API documentation for Marketstack uses XNAS in (some of) their examples. However, even if I copy-paste their https formatting directly, I only ever receive data from the IEXG exchange.

I've tried two ways:

stock_url = ("https://api.marketstack.com/v1/intraday" + 
             "?access_key=" + API_KEY + 
             "&symbols=" + symbol + 
             "&interval=15min" +
             "&exchange=XNAS" + 
             "&limit=1000" + 
             "&sort=desc")

and

stock_url = ("https://api.marketstack.com/v1/exchanges/XNAS/intraday" + 
             "?access_key=" + API_KEY + 
             "&symbols=" + symbol + 
             "&interval=15min" +
             "&limit=1000" + 
             "&sort=desc")

I've also tried putting the &exchange line in the second version as well.

I fetch the data using:

json.loads(requests.get(stock_url).content)

Does anyone know why I only ever receive IEXG data? You can see it in the snippet of result below:

{'open': 2.05, 'high': 2.06, 'low': 1.94, ... 'symbol': 'EDU', 'exchange': 'IEXG'}

Solution

  • I had same question and I asked MarketStack support. They told me that intraday endpoint supports only one exchange (IEXG). In my opinion, it's not obvious from the common description on their website. The exact answer from support is:

    Currently, Intraday data is available for all US stock tickers with data intervals as short as 1 minute. We are working on expanding our intraday data to other exchanges, at the moment we are using IEX data (Investors Exchange).