Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Bad Request. The value for variable api_key is not registered. #45

Open
Yushan-Liu opened this issue Oct 26, 2021 · 2 comments

Comments

@Yushan-Liu
Copy link

Dear developer,

I want to request 5 datasets, in total there are probably 2000 data points. Sometimes I can get them all without any issue. However, most of times after getting 2 or 3 datasets, the API threw an error "The value for variable api_key is not registered.". I googled online and it seems most people can get way more data points than me without a problem.

Here is how I query all my five datasets.

fred = Fred(api_key='xxxxxxxxxxxxxxxxx')

fetch_start_date='2000-01-01'

UMich_CCI_df = fred.get_series('UMCSENT', observation_start=fetch_start_date)
time.sleep(5)
Gas_Price_df = fred.get_series('GASREGCOVM', observation_start=fetch_start_date)
time.sleep(5)
GDP_Annual_Rate = fred.get_series('CPGDPAI', observation_start=fetch_start_date)
time.sleep(5)
Housing_Starts_df = fred.get_series('HOUST', observation_start=fetch_start_date)
time.sleep(5)
Unemployment_Rate_df = fred.get_series('UNRATE', observation_start=fetch_start_date)

I registered my API yesterday and pass it directly as the 'api_key' parameter. I am wondering if I am doing anything wrong here so I cannot always get all datasets.

I use Python 3.6 in conda environment. the Pandas version is 1.1.5.

I am sure this is not a bug in your repo but I just couldn't find a solution and don't understand why. Really appreciate if you can provide any help.

Best regards,

@Yushan-Liu
Copy link
Author

I also send an email to Fred to ask the limitation of API usage. Here is the response I got:

Thank you for your message. The FRED API allows 1000 items per request, with a rate limit of 120 requests per minute.

Have a great day,
FRED Team

I feel my request does not exceed the limits.

@TomasKoutek
Copy link

Thank you for sharing answer with limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants