Skip to main content

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

The Authorization 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

The Accept header tells the API what content type you expect in the response.
string
required
Expected response content type
You can also use:
Both formats are accepted by the API.

Origin

The Origin header indicates the origin of the request. This is required for CORS compliance.
string
required
Origin domain of the request
The API validates the Origin header for security. Always use https://pump.fun as the origin value.

Content-Type

For POST, PUT, and PATCH requests that include a request body, the Content-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
If the content hasn’t changed, the API returns a 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

Even if an endpoint doesn’t strictly require authentication, including the Authorization header ensures you receive complete data and avoid potential access restrictions.
For requests with a JSON body, always set Content-Type: application/json. Mismatched content types may result in 400 Bad Request errors.
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.
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.