Trade Analytics API

Unlock powerful onchain insights

A single, dedicated endpoint for historical trade data, enabling easy aggregation and analysis of user behavior, revenue insights and more.

Get started

Automate, Analyze, Adapt

Streamlined, Out-of-the-Box

Data without complex transformations
We return formatted data for fees, slippage and settled amounts alongside token metadata, reducing the time it takes to get insights for your business.

Instant USD Conversion

Eliminate the need for external pricing data
Get USD values for revenue and fees without the need to pull and join external pricing data. Simplify your workflow with pre-calculated USD estimates.

Track Revenue with Precision

Feed your internal dashboards
Monitor revenue by piping fee data in USD and token values directly into your internal dashboards. Fully customize what you see and how you see it.

Drill Down Mode

Granular insights at your fingertips
Easily drill down into specific trades for granular analysis. Slice and dice trade data to uncover patterns, anomalies, and insights, enabling smarter decisions.

Built for serious onchain apps

All historical trades:

Access to all historical trades at an individual level, easily aggregated for analytics use cases. Automate workflows without manual intervention.

Clean & Formatted:

Ready to ingest through performant endpoints. Pipe directly into your existing data pipelines.

Instant USD Values:

We return USD estimates for the amounts returned (buyAmount, sellAmount, integratorFee, zeroExFee), eliminating the need to join external pricing data

Revenue Tracking:

Get insights into your revenue health with comprehensive data on revenue and fees collected through your app.

Instant USD Values:

FP&A analysis made easy with apples to apples comparisons in USD values. Simplify your workflows, internal presentations and discussions.

Strategic Finance & BizOps:

An aggregate view for monitoring trends and drill down mode to QA and analyze trade-level details. Improve your team’s ability to make data-driven decision that impact your business.

All Your Data in One Stream:

Get access to all historical data to create reports and generate insights without having to rely on manual ad-hoc pulls.

Strategic Product Insights:

Get aggregate view for monitoring usage trends and drill down mode to interrogate specific user behaviors. Improve your orgs ability to make data-driven decision that impact your business.

Integrate in 5 minutes or less

Embed crypto trading in your app with just a few lines of code.

Play


const main = async () => {

	 const sellAmount = parseUnits("1000", await usdc.read.decimals());

  	// fetch quote
  	const quoteParams = new URLSearchParams({
  		chainId: client.chain.id.toString(),
    	sellToken: usdc.address,
    	buyToken: weth.address,
    	sellAmount: sellAmount.toString(),
      taker: client.account.address,
    });

  const quoteResponse = await fetch(
    "https://api.0x.org/swap/permit2/quote?" + quoteParams.toString(),
    {
      headers,
    }
  );

  const quote = await quoteResponse.json();
  console.log("Quote to swap 1000 USDC for WETH: ", quote);

}
main();

Play


const main = async () => {

	 const sellAmount = parseUnits("1000", await usdc.read.decimals());

  	// fetch quote
  	const quoteParams = new URLSearchParams({
  		chainId: client.chain.id.toString(),
    	sellToken: usdc.address,
    	buyToken: weth.address,
    	sellAmount: sellAmount.toString(),
      taker: client.account.address,
    });

  const quoteResponse = await fetch(
    "http://api.0x.org/gasless/quote?" + quoteParams.toString(),
    {
      headers,
    }
  );

  const quote = await quoteResponse.json();
  console.log("Quote to swap 1000 USDC for WETH: ", quote);

}
main();

Developer Guides

Tap into a decade of onchain expertise

Developer Guides

Fundamentals: SocialFi

Fundamentals: SocialFi

Unlock powerful onchain insights with 0x Trade Analytics API

Unlock powerful onchain insights with 0x Trade Analytics API

Fundamentals: Smart Contract Wallets

Fundamentals: Smart Contract Wallets

Compliance made easy with 0x Address Screening

Compliance made easy with 0x Address Screening

0x's next-gen pricing engine is now live

0x's next-gen pricing engine is now live

Introducing state-of-the-art Buy/Sell Tax support

Introducing state-of-the-art Buy/Sell Tax support

Take control of your balance sheet with 0x v2

Take control of your balance sheet with 0x v2

0x v2 bug bounty program

0x v2 bug bounty program

What does the "best price" in DeFi really mean?

What does the "best price" in DeFi really mean?

Eliminate allowance risk with Permit2

Eliminate allowance risk with Permit2

Introducing 0x's next-gen pricing engine

Introducing 0x's next-gen pricing engine

0x Dev Digest: May 2024

0x Dev Digest: May 2024

Frame spotlight: Paycaster

Frame spotlight: Paycaster

Frame spotlight: Airstack

Frame spotlight: Airstack

Power up your Farcaster Frames with 0x swaps

Power up your Farcaster Frames with 0x swaps

0x Dev Digest: April 2024

0x Dev Digest: April 2024

Introducing 0x Trade Analytics

Introducing 0x Trade Analytics

Coinbase Case Study

Coinbase Case Study

Introducing gasless swaps and approvals with Gasless API

Introducing gasless swaps and approvals with Gasless API

Bitcoin ETFs have arrived

Bitcoin ETFs have arrived

Building in the open: 0x pricing update

Building in the open: 0x pricing update

Matcha leverages Gasless API to bring users the most frictionless trading experience in DeFi

Matcha leverages Gasless API to bring users the most frictionless trading experience in DeFi

0x Dev Digest: October 2023

0x Dev Digest: October 2023

Monetize crypto trading in your app with Swap API

Monetize crypto trading in your app with Swap API

0x Dev Digest: September 2023

0x Dev Digest: September 2023

A comprehensive analysis of RFQ performance

A comprehensive analysis of RFQ performance

Unlock optimal trades in Swap API with 0x RFQ liquidity

Unlock optimal trades in Swap API with 0x RFQ liquidity

0x Dev Digest: August 2023

0x Dev Digest: August 2023

Portal launches swaps in its white label MPC wallet powered by 0x

Portal launches swaps in its white label MPC wallet powered by 0x

0x Swap API is now live on Base

0x Swap API is now live on Base

Introducing paid plans for Swap API

Introducing paid plans for Swap API

Decreasing Frictions in DeFi hackathon recap

Decreasing Frictions in DeFi hackathon recap

0x's pricing principles

0x's pricing principles

0x Dev Digest: June 2023

0x Dev Digest: June 2023

App spotlight: tastycrypto

App spotlight: tastycrypto

App spotlight: 31Third

App spotlight: 31Third

0x 101: Intro to gasless API

0x 101: Intro to gasless API

Inspiration for building with Swap API

Inspiration for building with Swap API

0x Dev Digest: May 2023

0x Dev Digest: May 2023

Fundamentals: What are gas fees?

Fundamentals: What are gas fees?

Decreasing Frictions in DeFi Hackathon

Decreasing Frictions in DeFi Hackathon

Swap API liquidity management

Swap API liquidity management

0x 101: Getting started with Swap API

0x 101: Getting started with Swap API

0x 101: Intro to Swap API

0x 101: Intro to Swap API

0x 101: Intro to 0x Orders

0x 101: Intro to 0x Orders

0x 101: Intro to 0x Protocol

0x 101: Intro to 0x Protocol

A new home for 0x Protocol

A new home for 0x Protocol

Say hi to the new 0x

Say hi to the new 0x

0x Year in Review 2022

0x Year in Review 2022

0x Swap API expands to Arbitrum

0x Swap API expands to Arbitrum

Managed liquidity

Managed liquidity

0x Smart Order Routing

0x Smart Order Routing

App spotlight: Taho

App spotlight: Taho

Fundamentals: What is a Layer 2 chain?

Fundamentals: What is a Layer 2 chain?

Fundamentals: What is the difference between quoted, executed, and adjusted prices?

Fundamentals: What is the difference between quoted, executed, and adjusted prices?

Fundamentals: What is price impact?

Fundamentals: What is price impact?

Fundamentals: What is slippage?

Fundamentals: What is slippage?

Fundamentals: What is an automated market maker (AMM)?

Fundamentals: What is an automated market maker (AMM)?

Fundamentals: What is market making?

Fundamentals: What is market making?

Fundamentals: What is a DEX aggregator?

Fundamentals: What is a DEX aggregator?

Fundamentals: What is liquidity?

Fundamentals: What is liquidity?

Fundamentals: What is a decentralized exchange (DEX)?

Fundamentals: What is a decentralized exchange (DEX)?

0x at ETHDenver 2023

0x at ETHDenver 2023

The 0x Mission and Values

The 0x Mission and Values

Announcing support for new testnets

Announcing support for new testnets

0x Swap API expands to Binance Smart Chain

0x Swap API expands to Binance Smart Chain

Scaling DeFi — Layer One

Scaling DeFi — Layer One

Introducing Slippage Protection

Introducing Slippage Protection

San Francisco Blockchain Week 2022 Recap

San Francisco Blockchain Week 2022 Recap

0x Swap API adds new liquidity sources

0x Swap API adds new liquidity sources

Review of slippage performance

Review of slippage performance

Phuture case study

Phuture case study

Measuring the impact of hidden DEX costs

Measuring the impact of hidden DEX costs

Market making in DeFi

Market making in DeFi

Introducing 0x Labs

Introducing 0x Labs

Introducing 0x Explorer

Introducing 0x Explorer

Growing DeFi with professional market makers

Growing DeFi with professional market makers

0x 101: How to Access 0x Data

0x 101: How to Access 0x Data

GameStop chooses 0x Swap API

GameStop chooses 0x Swap API

Build on Base with 0x

Build on Base with 0x

A comprehensive analysis on DEX liquidity aggregators’ performance

A comprehensive analysis on DEX liquidity aggregators’ performance

Announcing 0x Swap API v1

Announcing 0x Swap API v1

Access all DEX liquidity through 0x Swap API

Access all DEX liquidity through 0x Swap API

Announcing the 0xpo Summit 2022

Announcing the 0xpo Summit 2022

0x Protocol, a preview of what’s to come

0x Protocol, a preview of what’s to come

Update to our Privacy Policy

Update to our Privacy Policy

Price Impact Protection has arrived

Price Impact Protection has arrived

0x Limit Orders Go Multi-Chain

0x Limit Orders Go Multi-Chain

0x Labs raises $70M Series B led by Greylock to continue expanding Web3’s core exchange infrastructure

0x Labs raises $70M Series B led by Greylock to continue expanding Web3’s core exchange infrastructure

0x launches Tx Relay API in beta, with Robinhood Wallet as first partner

0x launches Tx Relay API in beta, with Robinhood Wallet as first partner

0x Labs raises $15M Series A to bring decentralized exchange markets to a global audience

0x Labs raises $15M Series A to bring decentralized exchange markets to a global audience

App spotlight: Zerion

App spotlight: Zerion

App spotlight: Matcha

App spotlight: Matcha

App spotlight: DexGuru

App spotlight: DexGuru

App spotlight: DEXTools

App spotlight: DEXTools

App spotlight: DODO

App spotlight: DODO

App spotlight: DappRadar

App spotlight: DappRadar

App spotlight: DeFi Saver

App spotlight: DeFi Saver

0x + Brave partner to make crypto and DeFi more accessible to everyone

0x + Brave partner to make crypto and DeFi more accessible to everyone

0x Swap API now supports 0x Protocol v4

0x Swap API now supports 0x Protocol v4