API Overview
Introduction
The 0x API provides a unified interface for liquidity aggregation, token swap pricing, and onchain trading. It is designed to help developers easily integrate token swaps and routing logic without managing individual DEX integrations.
The 0x API offers the following:
EVM Swap API
Endpoints for EVM-compatible chains (Ethereum, Arbitrum, Base, Polygon, and more):
- Swap: Generate executable quotes and calldata for token swaps using either the AllowanceHolder (recommended) or Permit2 approval models. Learn more in the FAQ.
- Gasless: Enable gasless swaps by sponsoring transaction fees on behalf of users, improving UX for end-user applications.
- Sources: Retrieve supported liquidity sources, chains, and token metadata used by the 0x routing engine.
- Trade Analytics: Query historical trade data, volumes, and execution details for monitoring and analytics use cases.
Solana Swap API
Endpoints for Solana (SVM):
- Swap Instructions: Generate swap instructions for Solana tokens, returning versioned transaction data ready to sign and submit.
Cross-Chain API
Endpoints for bridging assets across chains (EVM, Solana, Tron, HyperCore):
- Quotes: Get ready-to-sign bridge quotes across supported chains and assets.
- Status: Track the status of an in-flight cross-chain transaction.
- Sources: List supported bridge routes and liquidity sources.
- Transaction History: Get cross-chain transaction history for a user wallet address.
- Streaming Quotes: Subscribe to a live stream of cross-chain quotes.
Base URL
All requests to the 0x API must be made to the following base URL:
All requests must be sent over HTTPS. Requests made over HTTP will be rejected.
Authentication
All 0x API requests require an API key. Include your API key in the following request header:
Your 0x API key used to authenticate requests.
0x API version.
Requests missing this header may be rate-limited or rejected.
You can generate and manage API keys from the 0x Dashboard.
Chain Support
The 0x API supports multiple EVM-compatible chains. Each request must specify a chain either via the request path or query parameters, depending on the endpoint.
Refer to the Supported Chains for a complete and up-to-date list.