Search code examples
restalpha-vantage

How to get data from a specific Indice using Alpha Avantage?


Today I started to use Alpha Vantage and I got the API Key. So, I want get the data from BR, but on the documentation I can't see how I make the request, so how I do it?


Solution

  • TL;DR - Use the RIC code

    More information:
    A stock symbol is usually defined by appending the exchange to the end of the ticker. For example: Apple can be found on the NASDAQ, and the full ticker would be:

    AAPL.O
    

    Knowing this, the easiest way to get a ticker would be to use the RIC code lookup, and plug that in for the "symbol" section.

    B3 is a combination of 3 exchanges, and their tickers still use their old exchange suffix.

    For example, let's say you wanted to find Ambev Brewing company on the B3 excahnge. This company used to be traded on the Sao Paulo exchange, who's suffix was ".SA", so the full ticker would be:

    ABEV3.SA
    

    So your full URL to get intraday data from that exchange would be:

    https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=ABEV3.SA&interval=5min&apikey=<your_key_here>
    

    B3 has it's own conventions for tickers as well if you want to check out more information here