Overview
Proper HTTP headers are essential for successful API requests to the Pump.fun API. This guide covers all required and recommended headers to ensure your requests are processed correctly.Required Headers
Authorization
TheAuthorization header is required for authenticated endpoints and recommended for all requests.
string
required
Bearer token for JWT authentication
Most API endpoints require authentication. Include this header with all requests to ensure complete data retrieval and avoid access issues.
Accept
TheAccept header tells the API what content type you expect in the response.
string
required
Expected response content type
Origin
TheOrigin header indicates the origin of the request. This is required for CORS compliance.
string
required
Origin domain of the request
Content-Type
For POST, PUT, and PATCH requests that include a request body, theContent-Type header is required.
string
required
Format of the request body
Optional Headers
If-None-Match
Use this header for efficient caching. Include the ETag value from a previous response to check if content has changed.string
ETag value from previous response
304 Not Modified response, saving bandwidth.
See the Caching guide for more details.
Example Requests
GET Request
POST Request
Request with Caching
Header Quick Reference
Best Practices
Always include authentication
Always include authentication
Even if an endpoint doesn’t strictly require authentication, including the Authorization header ensures you receive complete data and avoid potential access restrictions.
Set the correct Content-Type
Set the correct Content-Type
For requests with a JSON body, always set
Content-Type: application/json. Mismatched content types may result in 400 Bad Request errors.Use caching headers
Use caching headers
Implement the
If-None-Match header with ETag values to reduce bandwidth and improve performance. The API will return 304 responses when content hasn’t changed.Validate origin
Validate origin
Always use
https://pump.fun as the Origin header value. Other origins may be rejected by CORS policies.Common Header Errors
For more information, see the Authentication and Error Handling guides.