My API key appears to be throttled / rate limited. Help?
Sometimes you get an error like the following when using the API:
HTTP 429 Too Many Requests
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Retry-After: 85774
Vary: Accept
{
"detail": "Request was throttled. Expected available in 85774 seconds."
}
Commonly, this happens if you're using the auth token improperly.
Authentication Docs Rate Limit Docs Your Usage and Access
Check if your program is running properly
You can check two things when this happens:
Check your profile and access limits. See How can I check my API usage?
If that process doesn't show much usage, you probably aren't authenticating properly and your usage is being recorded as anonymous.
Try loading the same URL via your browser when you're logged in. If that works, then your code isn't authenticating properly. This is because the front end serialization format (HTML) uses the same throttle framework as the JSON and XML serialization formats your code uses. So if it works in the browser but not your code, you're not throttled — your code has a problem.
Fixing the issue
If you're not authenticated properly, see the authentication docs about how to set things up:
https://www.courtlistener.com/api/rest-info/#authentication
Usually, you'll want to use the Authorization header. Don't forget the word Token as part of the header value!
If that still doesn't work
If you've done all of the above and you're still throttled, well, that means you're actually hitting a limit of how much you can use the API. It is a violation of our terms to set up multiple accounts to get around this.
We provide API access as a membership benefit or via commercial agreements.