Overview
The Pump.fun API implements rate limiting to ensure fair usage and maintain service stability. Rate limits restrict the number of requests you can make within a specific time window. Understanding and respecting these limits is crucial for building reliable applications.Rate Limit Headers
The API includes rate limiting information in response headers. Check these headers to monitor your usage:The maximum number of requests allowed in the current time window.
The number of requests remaining in the current time window.
The time when the rate limit window resets (Unix timestamp).
Example Response Headers
Rate Limit Response
When you exceed the rate limit, the API returns a429 Too Many Requests status code:
The
Retry-After header indicates how many seconds to wait before making another request.Checking Rate Limits
Monitor rate limit headers in your application to avoid hitting limits:Rate Limiting Strategies
Token Bucket Algorithm
Implement a token bucket to control request rates:Request Queue
Queue requests and process them at a controlled rate:Best Practices
Monitor rate limit headers
Monitor rate limit headers
Always check the
x-ratelimit-* headers in responses to track your usage and adjust request rates accordingly.Implement exponential backoff
Implement exponential backoff
When you receive a 429 error, wait before retrying. Use exponential backoff (1s, 2s, 4s, 8s) to avoid hammering the API.
Respect Retry-After header
Respect Retry-After header
When rate limited, always respect the
Retry-After header value. Don’t retry before this time has elapsed.Batch requests when possible
Batch requests when possible
Some endpoints support batch operations. Use them to reduce the number of individual requests.
Cache responses
Cache responses
Implement caching with ETags to reduce unnecessary requests. See the Caching guide for details.
Distribute load over time
Distribute load over time
Avoid bursts of requests. Spread requests evenly throughout the rate limit window.
Use webhooks if available
Use webhooks if available
Instead of polling endpoints repeatedly, use webhooks or server-sent events when available to receive updates.
Rate Limit Tiers
Rate limits may vary by endpoint and authentication level. Higher tier accounts or specific endpoints may have different limits.
General Guidelines
- Unauthenticated requests: Lower rate limits apply
- Authenticated requests: Standard rate limits based on account tier
- Admin endpoints: May have separate, stricter rate limits
- Read operations: Generally higher limits than write operations
- Batch endpoints: May have different limits than single-item endpoints
Handling Rate Limit Errors
When you encounter a 429 error:- Stop sending requests immediately - Don’t continue making requests
- Check the Retry-After header - Wait the specified number of seconds
- Implement exponential backoff - If no Retry-After header, use exponential backoff
- Log the incident - Track rate limit errors to identify patterns
- Adjust your application - Reduce request rate to stay within limits
Testing Rate Limits
When testing your rate limiting implementation:Related Guides
- Error Handling - Handle 429 errors properly
- Caching - Reduce request volume with caching
- Authentication - Rate limits may vary by auth level