stockalpha-vantage

Alpha Vantage API not working for Brazilian stocks


I am trying to fetch Brazilian stock prices with Alpha Vantage API. For this example, I'll talk about PETR4. I have used Alpha Vantage Search Endpoint. It returns the symbol of the currency:

{ "bestMatches": [ { "1. symbol": "PETR4.SAO", ... } }

Nevertheless, the TIME_SERIES_DAILY endpoint (or any other as a matter of fact) returns an error:

"Error Message": "Invalid API call. Please retry or visit the documentation (https://www.alphavantage.co/documentation/) for TIME_SERIES_DAILY."

Notice that it works with GOOG ticker, for example.


Solution

  • Try this: https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=PETR4.SA&apikey=xxx

    For all tickers from Alpha Vantage, you need to try the "ticker.exchange". PETR4 is listed on the B3 exchange.

    However, a number of Brazilian tickers were listed on the Sao Paolo exchange, which had the suffix .SA. This exchange has since merged with the B3 exchange, and it's suffix has not been changed. A good reference can be seen on the yahoo finance entry of the same ticker.