Rate Limits
The CDP API enforces rate limits to ensure fair usage and system stability. Rate limits are calculated using rolling 10-second windows and are applied separately for read and write operations.
Rate limit structure
Operation Type | Rate Limit | Time Window |
---|---|---|
Write APIs | 50 requests | 10 seconds |
Read APIs | 250 requests | 10 seconds |
Write operations
Write operations include any API endpoints that modify resources (POST
, PUT
, DELETE
methods). These are limited to 50 requests per 10 seconds.
Read operations
Read operations include any API endpoints that retrieve data (GET
methods). These are limited to 250 requests per 10 seconds.
Rate limit response
When you exceed the rate limit, the API will respond with a 429
(“Too Many Requests”) status code. The response will include an error object with details about the rate limit violation:
Best practices
To effectively work with these rate limits, consider implementing the following best practices:
Exponential backoff
You should implement an exponential backoff strategy to handle rate limit errors.
Cache responses
Caching improves performance and reduces unnecessary load on your server or APIs. You should:
- Cache frequently-accessed data locally when possible
- Implement response caching for read operations that don’t require real-time data
Batch Operations
Instead of making many individual requests, combine them into a single call and use bulk endpoints when possible.
Monitor usage
Given our rate limit structure, you should track your API usage to stay within limits, and set up alerts before reaching rate limit thresholds.
Rate Limits
Consider the following when designing your application around rate limits:
Optimize API usage
- Only request the data you need
- Use pagination for large data sets
- Implement efficient polling strategies
Handle rate limits gracefully
- Implement proper error handling for 429 responses
- Add retry logic with exponential backoff
- Consider using a queue system for high-volume operations
Plan for scale
- Design your application architecture to work within these limits
- Consider caching strategies for frequently-accessed data
- Distribute requests evenly across time windows when possible
Support
If you consistently hit rate limits and need higher limits for your use case, please reach out to us in the #wallet-api channel of the CDP Discord to discuss your requirements.