Update Alpha Vantage rate limit handling.

This commit is contained in:
Chris Berkhout 2024-08-03 17:15:17 +02:00
parent 1e1003994c
commit e8dec0bf64
2 changed files with 7 additions and 7 deletions

View file

@ -337,8 +337,8 @@ class AlphaVantage(BaseSource):
def _raise_for_generic_errors(self, data):
if type(data) is dict:
if "Note" in data and "call frequency" in data["Note"]:
raise exceptions.RateLimit(data["Note"])
if "Information" in data and "daily rate limits" in data["Information"]:
raise exceptions.RateLimit(data["Information"])
if (
"Information" in data
and "unlock" in data["Information"]

View file

@ -59,11 +59,11 @@ digital_url = re.compile(
)
rate_limit_json = (
'{ "Note": "'
"Thank you for using Alpha Vantage! Our standard API call frequency is 5 "
"calls per minute and 500 calls per day. Please visit "
"https://www.alphavantage.co/premium/ if you would like to target a higher "
"API call frequency."
'{ "Information": "'
"Thank you for using Alpha Vantage! Our standard API rate limit is 25 "
"requests per day. Please subscribe to any of the premium plans at "
"https://www.alphavantage.co/premium/ to instantly remove all daily rate "
"limits."
'" }'
)