Understanding Riot API rate limits
The Riot Games API enforces rate limits to ensure fair usage and system stability. Rate limits are applied per API key and vary depending on your key type.Development key limits
Development keys have the following rate limits:- 20 requests per second
- 100 requests per 2 minutes
Production key limits
Production keys have higher rate limits that vary based on your application’s approval level. You can view your specific limits in the Riot Developer Portal.Rate limit structure
Riot API uses a multi-tiered rate limiting system:- Application rate limits: Apply to your entire API key across all endpoints
- Method rate limits: Apply to specific API endpoints
- Service rate limits: Apply at the service level (automatically handled by Riot)
429 Too Many Requests response with a RiotAPIResponseError exception.
How Valaw handles rate limits
Valaw does not automatically handle rate limiting - it’s your responsibility to implement rate limit management in your application. When you exceed a rate limit, Valaw raises aRiotAPIResponseError with status code 429:
Implementing retry logic
When you hit a rate limit, implement retry logic with delays:Best practices for staying within limits
1. Implement request queuing
Use a queue to control the rate of outgoing requests:2. Batch requests efficiently
Minimize API calls by:- Caching responses when appropriate
- Using endpoints that return multiple records (e.g., matchlists)
- Avoiding repeated requests for the same data
3. Handle concurrent requests carefully
When making multiple concurrent requests, ensure you don’t exceed rate limits:4. Monitor your usage
Keep track of your API usage to avoid hitting limits:5. Use appropriate delays
When you receive a429 response, wait before retrying:
Complete example with rate limiting
Here’s a full example showing proper rate limit handling:Monitoring rate limit headers
While Valaw doesn’t expose rate limit headers directly, you can check the Riot API documentation for information about theX-App-Rate-Limit and X-Method-Rate-Limit headers that the API returns. Consider implementing custom request logging to track these headers.

