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."
}
The most common reason for this is that you're not using the auth token properly.
Check if your program is running properly
You can check two things when this happens:
Check your profile. 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 program 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, and it will use the cookie in your browser for authentication.
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.
If this you need help with this, please get in touch.