0x Trade Analytics API provides programmatic access to historical trades initiated through your apps via 0x Swap and Gasless APIs. Formatted for direct analytics use, this data enables you to derive actionable insights and business intelligence from your app’s trading activity.
The response includes comprehensive details for each trade, including the transaction hash, allowing you to verify the data on-chain.
TIP
Looking for trading insights without writing code?
👉 Use Trade Insights in the 0x Dashboard.
Need real-time transaction parsing instead?
👉 Check out 0x-parser — a TypeScript library for decoding onchain trade data.
To start using the Trade Analytics API, use the getSwapTrades and getGaslessTrades functions. Requests to the Trade Analytics APIs require a 0x-api-key. Data will be returned for the app associated with API key in the request.
The API updates with new settled trades roughly every 15 minutes. This data is however only considered final 48 hours after the trade is completed. This 48-hour finalization period accounts for potential latency from external providers, like token price sources, ensuring data accuracy and quality.
To ensure that your trading data is up to date, we recommend that you fetch and update data from the preceding 2 days in addition to the current day.
For downtime updates, you can track and subscribe here.
The API provides USD estimates for transaction volume and the fees generated from the swap. These values are based on an estimate of the token price at the time of the trade.