crflynn / pypistats.org

PyPI downloads analytics dashboard
https://pypistats.org/
141 stars 10 forks source link

API : Add a header for rate limiting #72

Open Riduidel opened 2 months ago

Riduidel commented 2 months ago

I'm working on a project to get download infos for various platforms (https://github.com/Riduidel/aadarchi-technology-detector). For this project, I scan pypistats result for ~ 300 packages. It seems like it's enough for my ip to get rate limited. And that's perfectly ok. However, is it possible to have an http header added in order for me to know how much request I can make, how long I'll have to wait, and so on?

hugovk commented 2 months ago

If it helps to know, the limit is 5 per second and 30 per minute:

https://github.com/crflynn/pypistats.org/blob/70a10f994173b4b9e8905fb3494dd5d0d5bd1bbb/pypistats/run.py#L23