> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.0x.org/api-reference/evm-ap-is/trade-analytics/trade-analytics-gasless/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.0x.org/_mcp/server. # getGaslessTrades GET https://api.0x.org/trade-analytics/gasless Get the list of completed gasless 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. Reference: https://docs.0x.org/api-reference/evm-ap-is/trade-analytics/trade-analytics-gasless ## Request ### Query parameters - `cursor` (string, optional) — 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. - `startTimestamp` (integer, optional) — 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. - `endTimestamp` (integer, optional) — 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. ### Headers - `0x-api-key` (string, required) — Visit dashboard.0x.org to get your API Key - `0x-version` (string, required) — API version ## Response ### 200 Successful response - `nextCursor` (string, required, nullable) — The cursor to fetch the next page of trades. If not present, there are no more trades to fetch for given parameters. - `trades` (list of TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItems, required) - `zid` (string, required) — The unique ZeroEx identifier of the request ## Errors ### 400 Bad Request Error 400 error response - `TradeAnalytics::gaslessRequestBadRequestError` ### 500 Internal Server Error 500 error response - `TradeAnalytics::gaslessRequestInternalServerError` ## Types ### TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItems - `appName` (string, required, nullable) — The name of the app that initiated the trade - `blockNumber` (string, required, nullable) — The block number at which the trade was executed - `buyToken` (string, required, nullable) — The contract address of the token received by the taker - `buyAmount` (string, required, nullable) — The settled amount on the `buyToken`, formatted by the token decimals - `chainId` (integer, required) — The ID of the chain where the trade was executed - `chainName` (string, required) — The name of the chain where the trade was executed - `fees` (TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFees, required) — The details about fees collected for the trade - `gasUsed` (string, required, nullable) — The amount of gas used in the trade - `protocolVersion` (enum, required, nullable) — The version of the 0x protocol used to execute the trade - Allowed values: `0xv4`, `Settler` - `sellToken` (string, required, nullable) — The contract address of the token spent by the taker - `sellAmount` (string, required, nullable) — The amount of the `sellToken`, formatted by the token decimals - `slippageBps` (string, required, nullable) — The slippage of the `buyToken` in bps - `taker` (string, required, nullable) — The wallet address of the taker​ - `timestamp` (integer, required) — The timestamp of the block containing the trade - `tokens` (list of TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsTokensItems, required) — Properties of the tokens involved in the trade - `tradeId` (integer, required) — Internal ID of the trade. Can be used together with `chainId`, `transactionHash`, and `zid` to uniquely identify a trade. - `transactionHash` (string, required) — The trade's transaction hash - `volumeUsd` (string, required, nullable) — The total volume of the trade in USD. This value is based on an estimate of the token price at the point of execution. - `zid` (string, required, nullable) — The `zid` corresponding to the trade - `service` (enum, required) - Allowed values: `gasless` ### INPUT_INVALID - `name` (enum, required) - Allowed values: `INPUT_INVALID` - `message` (string, required) - `data` (InputInvalidData, required) ### INTERNAL_SERVER_ERROR - `name` (enum, required) - Allowed values: `INTERNAL_SERVER_ERROR` - `message` (string, required) - `data` (InternalServerErrorData, required) ### UNCATEGORIZED - `name` (enum, required) - Allowed values: `UNCATEGORIZED` - `message` (string, required) - `data` (UncategorizedData, required) ### TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFees The details about fees collected for the trade - `integratorFee` (TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFeesIntegratorFee, required, nullable) — The details about the fee collected by integrator - `integratorFees` (list of TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFeesIntegratorFeesItems, required) — All integrator fees collected on the trade. May contain multiple entries when more than one integrator fee was charged. - `zeroExFee` (TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFeesZeroExFee, required, nullable) — The details about the fee collected by 0x ### TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsTokensItems Properties of the token involved in the trade - `address` (string, required, nullable) — The contract address of the token - `symbol` (string, required, nullable) — The symbol of the token ### InputInvalidData - `zid` (string, required) — The unique ZeroEx identifier of the request - `details` (list of InputInvalidDataDetailsItems, required) — The list of invalid inputs ### InternalServerErrorData - `zid` (string, required) — The unique ZeroEx identifier of the request ### UncategorizedData - `zid` (string, required) — The unique ZeroEx identifier of the request ### TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFeesIntegratorFee The details about the fee collected by integrator - `token` (string, required, nullable) — The contract address of the token in which the integrator collected a fee - `amount` (string, required, nullable) — The amount of the integrator fee, formatted by the token decimals - `amountUsd` (string, required, nullable) — The amount of the integrator fee in USD. - `recipient` (string, required, nullable) — The wallet address that received the integrator fee ### TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFeesIntegratorFeesItems - `token` (string, required, nullable) — The contract address of the token in which the integrator collected a fee - `amount` (string, required, nullable) — The amount of the integrator fee, formatted by the token decimals - `amountUsd` (string, required, nullable) — The amount of the integrator fee in USD. - `recipient` (string, required, nullable) — The wallet address that received the integrator fee ### TradeAnalyticsGaslessGetResponsesContentApplicationJsonSchemaTradesItemsFeesZeroExFee The details about the fee collected by 0x - `token` (string, required, nullable) — The contract address of the token in which 0x collected a fee - `amount` (string, required, nullable) — The amount of the 0x fee, formatted by the token decimals - `amountUsd` (string, required, nullable) — The amount of the 0x fee in USD. - `recipient` (string, required, nullable) — The wallet address that received the 0x fee ### InputInvalidDataDetailsItems - `field` (string, required) — The input field name - `reason` (string, required) — The validation failure reason ## Examples **Response** ```json { "nextCursor": null, "trades": [ { "appName": "Example app", "blockNumber": "123456", "buyToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "buyAmount": "0.0512", "chainId": 1, "chainName": "string", "fees": { "integratorFee": null, "integratorFees": [ { "token": "string", "amount": "string", "amountUsd": "string", "recipient": "string" } ], "zeroExFee": null }, "gasUsed": "141111", "protocolVersion": "Settler", "sellToken": "0x4d1c297d39c5c1277964d0e3f8aqqqq493664530", "sellAmount": "123.111", "slippageBps": "1", "taker": "0x23f2ad8e04dfdc0000a3e80891e3ae43f322000a", "timestamp": 1777772227, "tokens": [ { "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "symbol": "ETH" }, { "address": "0xaaaaaaaaaaaaaa277964d0e3f8aa901493664530", "symbol": "TKN" } ], "tradeId": 1, "transactionHash": "0x42bad789ddd64aaaaaaaaaaaceb795063f5623558f130e0f4d30ad399b041411", "volumeUsd": "139.73", "zid": "0x04baaaaaaa1f1af0304eb412", "service": "gasless" } ], "zid": "0xaaaaaae1b3bf43f082d5012d" } ``` **SDK Code** ```python Trade Analytics_tradeAnalytics::gasless_example import requests url = "https://api.0x.org/trade-analytics/gasless" querystring = {"cursor":"eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0=","startTimestamp":"1729032210","endTimestamp":"1729032211"} headers = { "0x-api-key": "0x-api-key", "0x-version": "v2" } response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Trade Analytics_tradeAnalytics::gasless_example const url = 'https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211'; const options = {method: 'GET', headers: {'0x-api-key': '0x-api-key', '0x-version': 'v2'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Trade Analytics_tradeAnalytics::gasless_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("0x-api-key", "0x-api-key") req.Header.Add("0x-version", "v2") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Trade Analytics_tradeAnalytics::gasless_example require 'uri' require 'net/http' url = URI("https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["0x-api-key"] = '0x-api-key' request["0x-version"] = 'v2' response = http.request(request) puts response.read_body ``` ```java Trade Analytics_tradeAnalytics::gasless_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211") .header("0x-api-key", "0x-api-key") .header("0x-version", "v2") .asString(); ``` ```php Trade Analytics_tradeAnalytics::gasless_example request('GET', 'https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211', [ 'headers' => [ '0x-api-key' => '0x-api-key', '0x-version' => 'v2', ], ]); echo $response->getBody(); ``` ```csharp Trade Analytics_tradeAnalytics::gasless_example using RestSharp; var client = new RestClient("https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211"); var request = new RestRequest(Method.GET); request.AddHeader("0x-api-key", "0x-api-key"); request.AddHeader("0x-version", "v2"); IRestResponse response = client.Execute(request); ``` ```swift Trade Analytics_tradeAnalytics::gasless_example import Foundation let headers = [ "0x-api-key": "0x-api-key", "0x-version": "v2" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.0x.org/trade-analytics/gasless?cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAwMDAsInRyYW5zYWN0aW9uSGFzaCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIiwidHJhZGVJZCI6MH0%3D&startTimestamp=1729032210&endTimestamp=1729032211")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > Developer documentation for the 0x API. Embed swaps in your onchain app. Access 10+ million tokens with liquidity from 150+ exchanges with a single API.