cambialens / lens-api-doc

10 stars 5 forks source link

Rate Limit Reached #45

Closed mashrekur closed 2 years ago

mashrekur commented 3 years ago

Hi there,

I was exploring the Lens Scholarly API and trying to download some article metadata. Unfortunately, I unintentionally hit the rate limit and now I'm getting response codes of '429'.

I was using the example code for cursor-based pagination in Python provided in the documentation. Is there any way the limit against my id can be lifted?

Do you also have suggestions on how this situation can be avoided in the future?

rosharma9 commented 3 years ago

This point will give you usage for current subscription. If your monthly quota is reached, you might need to re-request for a new subscription plan or have to wait until your x-rate-limit-reset-date (from the http headers of any scholarly search request). https://api.lens.org/subscriptions/scholarly_api/usage?token=YOUR_TOKEN If you are getting 429 because of your per-minute quota, you might need to implement higher sleep value based on your plan. time.sleep(8) https://docs.api.lens.org/samples-scholar.html#python---cursor-based-pagination