0x · Example Payload

0X Trade Analytics Swap Example

CryptocurrencyDeFiDEX AggregatorSwapGaslessCross-ChainPermit2LiquidityTrade AnalyticsWeb3SettlementSmart Contracts

0X Trade Analytics Swap Example is an example object payload from 0x, with 2 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

requestresponse

Example Payload

Raw ↑
{
  "request": {
    "method": "GET",
    "url": "https://api.0x.org/trade-analytics/swap?chainId=1&startTimestamp=1735603200&endTimestamp=1735689600&limit=2",
    "headers": {
      "0x-api-key": "YOUR_API_KEY",
      "0x-version": "v2"
    }
  },
  "response": {
    "status": 200,
    "body": {
      "trades": [
        {
          "tradeHash": "0x9999888877776666555544443333222211110000aaaabbbbccccddddeeeeffff",
          "transactionHash": "0xfaceb00c000000000000000000000000000000000000000000000000deadbeef",
          "chainId": 1,
          "timestamp": 1735604000,
          "taker": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
          "buyToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "sellToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
          "buyAmount": "2629142387",
          "sellAmount": "1000000000000000000",
          "integratorFeeAmount": "3943713",
          "integratorFeeRecipient": "0x9999888877776666555544443333222211110000",
          "surplus": "1234567",
          "gasUsed": "212450",
          "blockNumber": "20850142",
          "route": {
            "fills": [{"source": "Uniswap_V3", "proportionBps": "10000"}]
          }
        },
        {
          "tradeHash": "0x1111222233334444555566667777888899990000aaaabbbbccccddddeeeeffff",
          "transactionHash": "0xbeefcafe00000000000000000000000000000000000000000000000000d00d00d",
          "chainId": 1,
          "timestamp": 1735612400,
          "taker": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
          "buyToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
          "sellToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "buyAmount": "500000000000000000",
          "sellAmount": "1320000000",
          "integratorFeeAmount": "1980000",
          "integratorFeeRecipient": "0x9999888877776666555544443333222211110000",
          "surplus": "0",
          "gasUsed": "186200",
          "blockNumber": "20850698",
          "route": {
            "fills": [
              {"source": "Curve", "proportionBps": "5000"},
              {"source": "Balancer_V2", "proportionBps": "5000"}
            ]
          }
        }
      ],
      "next": "eyJjdXJzb3IiOiIyMDg1MDY5OCJ9"
    }
  }
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/0x-trade-analytics-swap-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.