Skip to main content

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

OK
Request succeeded. The response body contains the requested data.
Created
Resource successfully created. Common for POST requests that create new resources.
Not Modified
Content hasn’t changed since the last request. Used with ETag caching. See Caching for details.

Client Error Codes

Bad Request
The request is malformed or contains invalid parameters. Check your request body, query parameters, and headers.
Unauthorized
Authentication is required or the provided JWT token is invalid or expired. Include a valid token in the Authorization header.
Forbidden
The request is authenticated but you don’t have permission to access the resource. This may indicate insufficient privileges.
Not Found
The requested resource doesn’t exist. Verify the endpoint URL and resource identifiers.
Too Many Requests
You’ve exceeded the rate limit. Slow down your requests and check the rate limit headers. See Rate Limiting for details.

Server Error Codes

Internal Server Error
The server encountered an unexpected error. Retry your request after a brief delay.
Bad Gateway
The server received an invalid response from an upstream server. Retry after a delay.
Service Unavailable
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

Problem: Your JWT token is missing, invalid, or has expired.Solution:
  • Verify you’re including the Authorization header
  • Check the token format: Bearer <token>
  • Re-authenticate using the /auth/login endpoint to obtain a fresh token
  • Implement automatic token refresh in your application
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
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)
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
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

Always implement proper error handling in production applications. Unhandled errors can lead to poor user experience and application crashes.
  1. Log errors with context - Include the endpoint, request parameters, and timestamp
  2. Retry transient failures - Use exponential backoff for 5xx errors and rate limits
  3. Don’t retry authentication errors - 401 errors require re-authentication, not retries
  4. Handle rate limits gracefully - Respect the Retry-After header
  5. Monitor error rates - Track error patterns to identify systemic issues
  6. Provide user feedback - Display meaningful error messages to end users
  • 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