0x Documentation
An introduction to how the 0x API /swap endpoint works and the resources included this section

What is the 0x API /swap Endpoint?

0x API’s /swap endpoint facilitates consuming the best-priced liquidity from the greater DEX ecosystem, including on-chain and off-chain liquidity networks. Under the hood, the API performs three tasks:
  • Queries prices from multiple DEXs and market makers and aggregates the liquidity from the queried sources to provide the best price possible. Think of how Google flights aggregates flight prices for a certain time and date to help you find the best price, /swap similarly helps you find the best price across DeFi liquidity sources.
  • 0x API’s smart order routing algorithm splits up your transaction across different sources to maximize the overall return on your swap. Read more about smart order routing here.
  • API responses are returned in a format that can be easily executed using the Web3 library of your choice
Also, the 0x API watches out for your users. 0x collects 0% of positive slippage. In cases of positive slippage, the 0x protocol returns that difference back to the user.
This API is intended for public use. If you are an integrator who needs access higher rate limits, please fill out the 0x API Taker Integration Request Form.
0x API's smart order routing algorithm helps users get the best price by splitting the swap across different DEXes.

Get Started

This section contains the following docs and guides

API References

Advanced Topics