Overview
The Pump.fun API uses standard HTTP status codes to indicate the success or failure of requests. Understanding these status codes and implementing proper error handling is essential for building robust applications.HTTP Status Codes
Success Codes
Request succeeded. The response body contains the requested data.
Resource successfully created. Common for POST requests that create new resources.
Content hasn’t changed since the last request. Used with ETag caching. See Caching for details.
Client Error Codes
The request is malformed or contains invalid parameters. Check your request body, query parameters, and headers.
Authentication is required or the provided JWT token is invalid or expired. Include a valid token in the Authorization header.
The request is authenticated but you don’t have permission to access the resource. This may indicate insufficient privileges.
The requested resource doesn’t exist. Verify the endpoint URL and resource identifiers.
You’ve exceeded the rate limit. Slow down your requests and check the rate limit headers. See Rate Limiting for details.
Server Error Codes
The server encountered an unexpected error. Retry your request after a brief delay.
The server received an invalid response from an upstream server. Retry after a delay.
The service is temporarily unavailable. This may occur during maintenance. Retry with exponential backoff.
Error Response Format
When an error occurs, the API typically returns a JSON response with error details:The exact error response format may vary by endpoint. Always check the response body for additional context when debugging errors.
Handling Errors
Basic Error Handling
Advanced Error Handling with Retries
Common Error Scenarios
401 Unauthorized - Invalid or Expired Token
401 Unauthorized - Invalid or Expired Token
403 Forbidden - Insufficient Permissions
403 Forbidden - Insufficient Permissions
Problem: Your account doesn’t have permission to access the resource.Solution:
- Verify your account has the necessary permissions
- Check if the endpoint requires admin or super admin privileges
- Contact support if you believe you should have access
404 Not Found - Invalid Endpoint or Resource
404 Not Found - Invalid Endpoint or Resource
Problem: The endpoint or resource doesn’t exist.Solution:
- Verify the endpoint URL is correct
- Check that resource identifiers (mint addresses, user IDs) are valid
- Ensure you’re using the correct API version (v3 is current)
429 Too Many Requests - Rate Limit Exceeded
429 Too Many Requests - Rate Limit Exceeded
Problem: You’ve sent too many requests in a short period.Solution:
- Check the
x-ratelimit-*response headers for limit information - Implement rate limiting in your application
- Use exponential backoff when retrying
- See Rate Limiting for best practices
500/502/503 Server Errors
500/502/503 Server Errors
Problem: The server encountered an error or is temporarily unavailable.Solution:
- Retry the request after a delay
- Implement exponential backoff (wait 1s, 2s, 4s, etc.)
- Check the API status page for known issues
- If errors persist, contact support
Best Practices
- Log errors with context - Include the endpoint, request parameters, and timestamp
- Retry transient failures - Use exponential backoff for 5xx errors and rate limits
- Don’t retry authentication errors - 401 errors require re-authentication, not retries
- Handle rate limits gracefully - Respect the
Retry-Afterheader - Monitor error rates - Track error patterns to identify systemic issues
- Provide user feedback - Display meaningful error messages to end users
Related Guides
- Authentication - Learn about JWT token management
- Rate Limiting - Understand rate limits and how to avoid them
- Caching - Use caching to reduce errors and improve performance