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.
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.
Expected response content type
Origin
TheOrigin header indicates the origin of the request. This is required for CORS compliance.
Origin domain of the request
Content-Type
For POST, PUT, and PATCH requests that include a request body, theContent-Type header is 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.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
| Header | Value | Required | Use Case |
|---|---|---|---|
Authorization | Bearer <JWT> | Yes | Authentication for all protected endpoints |
Accept | application/json or */* | Yes | Specify expected response format |
Origin | https://pump.fun | Yes | CORS compliance |
Content-Type | application/json | For POST/PUT/PATCH | Specify request body format |
If-None-Match | W/"etag-value" | Optional | Enable response caching |
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
| Issue | Cause | Solution |
|---|---|---|
401 Unauthorized | Missing or invalid Authorization header | Include valid JWT token in Authorization header |
400 Bad Request | Missing Content-Type on POST/PUT | Add Content-Type: application/json header |
403 Forbidden | Invalid Origin header | Use Origin: https://pump.fun |