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

Example for backfilling data (and handling rate limits) #2

Open
tiagosiebler opened this issue Sep 10, 2022 · 1 comment
Open

Example for backfilling data (and handling rate limits) #2

tiagosiebler opened this issue Sep 10, 2022 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tiagosiebler
Copy link
Owner

No description provided.

@tiagosiebler tiagosiebler added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 10, 2022
@McFlyOne
Copy link

Identify the time period for which data needs to be backfilled. This might be a specific date range, or it might be all data up until the present day.

Divide the time period into smaller chunks. This can help to minimize the impact of rate limits, as making many smaller requests is less likely to exceed the rate limit than making a few large requests.

Make a request to the API for data within each time chunk. If the request is successful, store the data in a database or other storage system.

If the request fails due to a rate limit error, pause for a period of time (as specified by the API) before retrying the request. This allows the rate limit to reset and avoids continuously hitting the rate limit.

Repeat this process for each time chunk until the entire time period has been backfilled.

It is important to note that rate limits can vary by API and may change over time. It is a good idea to check the API documentation or make a test request to determine the current rate limits before beginning the backfilling process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants