11

I was trying to get JSON for a company by calling API of alphavantage .For some company data is coming and for some company, it's failing. Company for which data are coming - TCS,INFY,MSFT Company for which data are failing - TATAMOTORS,RCOM,SBIN

Link for TCS JSON

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=TCS&outputsize=full&apikey={API_KEY}

LINK for TATAMOTORS

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=TATAMOTORS&outputsize=full&apikey={API_KEY}

Can anyone please help me why this is happening?

amhndu
  • 15
  • 4
nil96
  • 313
  • 1
  • 3
  • 12

7 Answers7

19

The solution is to include exchange in the symbol as follows:

symbol=EXCHANGE:SYMBOL

For example, for query works : https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=NSE:TATAMOTORS&outputsize=full&apikey={API_KEY}

amhndu
  • 15
  • 4
  • Have a query regarding calling exhange:symbol via alpha vantage The following works https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=NSE:TATAMOTORS&interval=1min&apikey=xxxx works But the following does not work https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=NSE:TATAMOTORS&interval=1min&apikey=xxxx Dont know why – Karan Bhandari Dec 03 '17 at 05:01
  • @SandeepDeshmukh turns out there batch api call using this strategy still doesn't work. For example, https://www.alphavantage.co/query?function=BATCH_STOCK_QUOTES&symbols=NSE:TATAMOTORS,NSE:TCS&apikey=MCAF9B429I44328U doesn't work.. Any ideas on how to get them working? – Laks Jan 26 '18 at 14:04
  • Unfortunately I found their APIs for India market not so matured and completely missing documentation. – Sandeep Deshmukh Jan 28 '18 at 02:20
  • symbol=EXCHANGE:SYMBOL is not working since a week now. any other solution I can try? – Ashok Regar Jun 20 '20 at 06:10
  • Downvoted. Even though the answer might be correct. It's not working as of now. – Han Jul 19 '20 at 05:56
  • Not anymore a solution to the initial question – code-freeze Feb 21 '21 at 17:35
  • In my case : Below URL is working : https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=BSE:RELIANCE&apikey=<> But when I tried to get OVERVIEW of the same company, it is not giving me any response : https://www.alphavantage.co/query?function=OVERVIEW&symbol=BSE:BSE:RELIANCE&apikey=<> – Hiren Jul 14 '21 at 07:42
9

First of all to get data of TataMotors You have to change your symbol to TTM instead of TATAMOTORS

See Here

here is your TTM's Data

https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=TTM&interval=1min&apikey=yourapiket&datatype=json

In My case :

I want to get stock data of Infosys Ltd NSE stock. incase symbol is INFY

get get Stock data of this company i just tried "INFY.NS"

it's working you can check url by putting your api key to the url

https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=INFY.NS&interval=1min&apikey=yourapikey

You have to find proper symbol for all company which will be found from my google drive : Download Complete CSV Data

Rohit Chauhan
  • 1,119
  • 1
  • 12
  • 30
  • Is there any way I can get intraday data for a particular date using alpha vantage? – JustTry Dec 15 '18 at 20:42
  • 1
    your list has only 130 companies for Indian market ? – penta Sep 01 '19 at 12:06
  • @penta sorry for that, it was for example.but you can download full list here https://stackoverflow.com/a/25339061/9024123 – Rohit Chauhan Sep 01 '19 at 16:30
  • @Rj_Innocent_Coder are you talking about the dubstockapi from the comments ? If yes, is that reliable to be used with alpha vantage ? I am getting a lot of "Invalid API call. Please retry or visit the documentation " – penta Sep 02 '19 at 07:28
  • Sorry @penta bro, i had analyse the whole pattern at that time, currently i am not into it. – Rohit Chauhan Sep 10 '19 at 18:08
1

It seems that Alpha Vantage might be highly variable (and possibly unreliable) in the data they offer. I am looking for a source for the Australian All Ordinaries index (XAO). The Australian ASX200 index is available on AV simply as XJO, but not XAO.

I asked them how to access foreign exchange indexes, eg XAO, here is the response:

"The short answer to your question on the symbol/exchange list is: there is no quick & simple way to describe the list of exchanges or symbols of our API service. For example, we have the following complicating factors:

  • Our upstream data providers are no longer supporting certain unlisted equities or certain penny stocks. Please read "certain" as "lack of patterns."

  • Our users have reported success in retrieving stock data from major global markets (such as LON:III) or indices (such as DJIA for Dow Jones, IXIC for NASDAQ, and SPX for SP500, etc.). But again, a generalizable pattern is yet to emerge.

  • Our team has been experimenting with a brute-force compilation of all the supported symbols (US and international alike). However, even the slightest update from our data providers will render the compilation obsolete, posing significant scalability and user experience issues to our platform.

  • Given our free for all business model and the autonomy of our third-party vendors, we decided not yet to maintain a static database of our exchange and symbol formations.

AndrewS
  • 39
  • 1
1

See this image for reference

If you see json data return from Function "SYMBOL_SEARCH" carefully, you will observed that for NSE it's symbol is TATAMOTORS.NSE and for BSE it is TATAMOTORS.BSE. Always send symbol as it is which you get in "SYMBOL_SEARCH" method.

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=TATAMOTORS.NSE&outputsize=full&apikey=MCAF9B429I44328U

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=TATAMOTORS.BSE&outputsize=full&apikey=MCAF9B429I44328U

  • Using the search function for URBI, I get for example URBI.MEX. So, as stated I use this: https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=URBI.MEX&outputsize=full&apikey=nnnnnnn I get back an Invalid API call. What gives? – Molasar Nov 17 '19 at 18:46
1

Alpha Vantage is showing the BSE data accurately. All you need to do it add .BO at the end of the symbol. (SBIN.BO for example) I'm not sure how to get NSE data, if at all it is possible.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Prateek
  • 11
  • 1
  • What does adding the `.BO` do? That might be useful to add to this answer, since you're the first contributor to suggest this. – Jeremy Caney Jun 21 '20 at 17:57
1

It would be better if refer to original documentation.

Link: https://www.alphavantage.co/documentation/

Drag down to TIME_SERIES_DAILY

To fetch data of stocks to various exchange's round the world you will need to add exchange symbol as a suffix. For Example. SBIN.BSE, RCOM.BSE i.e .BSE for Bombay Stock Exchange(India), .SHH for Shanghai Stock Exchange(China) etc.

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=SBIN.BSE&outputsize=full&apikey={your_key}

-2

I've noticed with Alpha Vantage that when I am retrieving data for a list of stocks, occasionally the response will have an empty body.

  1. Are you having this error for the same stock tickers each time you fetch data, or is it happening for different tickers each time?
  2. What does the response body look like?
  3. When did the problem start? Has it always been like this, or is it intermittent?

It seems to be a bug on their end, and it seems to follow a period of 500 server errors to the effect of "Heroku App: Application Error". It doesn't happen every day, and it also doesn't happen for the same stock ticker each time I fetch data.

In short, it's a server-side bug. But hey, it's a free service and it's usually pretty great.

Since the error doesn't happen for the same stock each time, I added a retry feature, and that results in a mostly-complete set of data on days when the service is buggy.