Skip to main content

Bungee Auto API Reference

The Bungee Auto API provides endpoints for integrating swaps into your application.

API Endpoints

Bungee provides three different API endpoints to suit different use cases:

Public Endpoint

https://public-backend.bungee.exchange
  • Rate Limit: 20 requests per minute (RPM) per IP address
  • Authentication: None required
  • Use Case: Development and testing
  • Access: Open to all

Versioning

All endpoints are versioned using the /api/v1 prefix in the path. For example:

https://public-backend.bungee.exchange/api/v1/bungee/quote

Requesting Production API Access

For production use with higher rate limits or domain whitelisting, please fill out the Bungee API Access Request Form to request dedicated API keys and access to our production endpoints.

Production API Endpoints (Click to Expand)

Dedicated Endpoint

https://dedicated-backend.bungee.exchange
  • Rate Limit: Custom RPM based on your needs
  • Authentication: API key required via x-api-key header
  • Use Case: Production applications requiring higher rate limits
  • Access: Available by request only

Example usage with API key:

curl --location 'https://dedicated-backend.bungee.exchange/api/v1/supported-chains' \
--header 'x-api-key: [API-KEY]'

Domain-Restricted Endpoint

https://backend.bungee.exchange
  • Rate Limit: Custom RPM per IP address
  • Authentication: None, but domain whitelisting required
  • Use Case: Production applications with domain restrictions
  • Access: Available by request only for whitelisted domains

Available Endpoints

EndpointDescription
/api/v1/supported-chainsGet a list of supported chains
/api/v1/tokens/listGet a list of available tokens
/api/v1/tokens/searchSearch for specific tokens
/api/v1/bungee/quoteGet pricing information for swaps
/api/v1/bungee/submitSubmit swap requests
/api/v1/bungee/build-txBuild transaction data for Bungee Manual
/api/v1/bungee/statusCheck the status of submitted requests

Server Request ID

All responses include a server-req-id header that can be used for debugging purposes when contacting support. When encountering any errors or unexpected behavior:

  1. Always capture and log this ID along with the error details
  2. Include this ID when reporting issues to the Bungee team
  3. Add the ID to any error messages shown to users to facilitate troubleshooting

Example of capturing the server-req-id in error handling:

async function getQuote(params) {
const url = `${BUNGEE_API_BASE_URL}/api/v1/bungee/quote`;
const queryParams = new URLSearchParams(params);
const queryUrl = `${url}?${queryParams}`;
const response = await fetch(queryUrl);
const data = await response.json();
const serverReqId = response.headers.get("server-req-id");

if (!data.success) {
throw new Error(
`Quote error: ${data.statusCode}: ${data.message}. server-req-id: ${serverReqId}`
);
}

return data.result;
}

The server-req-id provides the Bungee team with crucial information to trace the exact request through their systems, significantly improving debugging efficiency and resolution time.