For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Contact SupportDiscordGo to dashboard
HomeDocsAPI ReferenceLiquidity IntegrationChangelog
HomeDocsAPI ReferenceLiquidity IntegrationChangelog
    • API Overview
  • EVM APIs
      • GETgetSwapTrades
      • GETgetGaslessTrades
  • Solana Swap APIs
  • Cross-Chain APIs
LogoLogo
Contact SupportDiscordGo to dashboard
EVM APIsTrade Analytics

getSwapTrades

||View as Markdown|
GET
https://api.0x.org/trade-analytics/swap
GET
/trade-analytics/swap
$curl -G https://api.0x.org/trade-analytics/swap \
> -H "0x-api-key: 0x-api-key" \
> -H "0x-version: v2" \
> -d cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAsInppZCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIn0 \
> -d startTimestamp=1729032210 \
> -d endTimestamp=1729032211
1{
2 "nextCursor": null,
3 "trades": [
4 {
5 "appName": "Example app",
6 "blockNumber": "123456",
7 "buyToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
8 "buyAmount": "0.0512",
9 "chainId": 1,
10 "chainName": "string",
11 "fees": {
12 "integratorFee": null,
13 "zeroExFee": null
14 },
15 "gasUsed": "141111",
16 "protocolVersion": "Settler",
17 "sellToken": "0x4d1c297d39c5c1277964d0e3f8aqqqq493664530",
18 "sellAmount": "123.111",
19 "slippageBps": "1",
20 "taker": "0x23f2ad8e04dfdc0000a3e80891e3ae43f322000a",
21 "timestamp": 1777772227,
22 "tokens": [
23 {
24 "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
25 "symbol": "ETH"
26 },
27 {
28 "address": "0xaaaaaaaaaaaaaa277964d0e3f8aa901493664530",
29 "symbol": "TKN"
30 }
31 ],
32 "transactionHash": "0x42bad789ddd64aaaaaaaaaaaceb795063f5623558f130e0f4d30ad399b041411",
33 "volumeUsd": "139.73",
34 "zid": "0x04baaaaaaa1f1af0304eb412",
35 "service": "swap"
36 }
37 ],
38 "zid": "0xaaaaaae1b3bf43f082d5012d"
39}
Get the list of completed swap trades. Returns a maximum of 200 trades per request. Visit [here](https://docs.0x.org/docs/trade-analytics-api/introduction) for more details about how the API works.
Was this page helpful?
Previous

getSources

Next

getGaslessTrades

Built with

Get the list of completed swap trades. Returns a maximum of 200 trades per request. Visit here for more details about how the API works.

Headers

0x-api-keystringRequired
Visit dashboard.0x.org to get your API Key
0x-versionstringRequired
API version

Query parameters

cursorstringOptional

A pagination cursor used to fetch the next page of trades. It should be set to null for the initial request; otherwise, it should be the value of nextCursor that is returned from getSwapTrades or getGaslessTrades calls.

startTimestampintegerOptional
Unix timestamp in seconds, specifying the starting point of the time range filter. Only trades completed on or after this timestamp will be included in the response.
endTimestampintegerOptional
Unix timestamp in seconds, specifying the end point of the time range filter. Only trades completed on or before this timestamp will be included in the response.

Response

Successful response
nextCursorstring or null
The cursor to fetch the next page of trades. If not present, there are no more trades to fetch for given parameters.
tradeslist of objects
zidstring
The unique ZeroEx identifier of the request

Errors

400
Bad Request Error
500
Internal Server Error