0x API

0x API is an HTTP API that gives ex­ter­nal de­vel­op­ers ac­cess to all of 0x liq­uid­ity and tool­ing. More im­por­tantly, it goes be­yond 0x and is the best way to ac­cess liq­uid­ity in all of Decentralized Finance, as it ag­gre­gates liq­uid­ity from all avail­able sources, giv­ing the end-user the best pos­si­ble deal.

Implementing Ethereum to­ken pur­chas­ing is ex­tremely de­vel­oper friendly, and re­quires less than ten lines of code.

// Get a quote to sell 1 ETH to buy DAI
const response = await fetch(
'https://api.0x.org/swap/v0/quote?sellToken=ETH&buyToken=DAI&sellAmount=1000000000000000000'
)
const quote = await response.json()
// Send to ethereum with your favorite Web3 Library
window.web3.eth.sendTransaction(quote, (err, txId) => {
console.log('Success!', txId)
})

The API av­er­ages mil­lions of dol­lars per day in crypto trad­ing vol­ume, and han­dles hun­dreds of re­quests per sec­ond with­out a hic­cup. It pro­vides the swap­ping func­tion­al­ity be­hind many pop­u­lar Decentralized Finance apps such as Zerion, Relay, and Matcha. It also rep­re­sents the first pub­lic-fac­ing ser­vice with an SLA, on-call ro­ta­tion, and sta­tus page run by 0x en­gi­neer­ing.