Alpha Vantage randomly says Invalid API Call
Asked Answered
O

1

0

I have code in python that periodically fetches data for a particular ticker.

import pandas as pd
import time
def intraday(ticker, interval, key):
    """
    Returns interday data
    """
    url = f'https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol={ticker}&interval={interval}&apikey={key}&datatype=csv'
    df = pd.read_csv(url)
    df = df.reset_index()

while True:
    print(intraday('AAPL', '1min', key)
    time.sleep(60)

The problem that I face, is that this code works well most of the time. However, occasionally, it throws an error, saying "Invalid API call".

This doesn't happen all the time. Maybe once is 3-4 calls. Sometimes at in the first call.

I'm in no way modifying anything else as well

What's going on?

Oleo answered 25/6, 2020 at 9:3 Comment(0)
M
4

Yes same issue here, but do not fear, it doesn't seem to be an issue with your code. The api response seems down across the board. Even their demo requests aren't working e.g https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=IBM&interval=5min&apikey=demo from https://www.alphavantage.co/documentation/

Hopefully it will be fixed soon!

Maniple answered 25/6, 2020 at 11:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.