Batch download trades with filters
curl --request GET \
--url https://demo-api.mobula.io/api/2/trades/filtersimport requests
url = "https://demo-api.mobula.io/api/2/trades/filters"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/trades/filters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.mobula.io/api/2/trades/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api.mobula.io/api/2/trades/filters"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/trades/filters")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/trades/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"operation": "regular",
"type": "buy",
"baseTokenAmount": 123,
"baseTokenAmountRaw": "<string>",
"baseTokenAmountUSD": 123,
"quoteTokenAmount": 123,
"quoteTokenAmountRaw": "<string>",
"quoteTokenAmountUSD": 123,
"date": 123,
"swapSenderAddress": "<string>",
"transactionSenderAddress": "<string>",
"blockchain": "<string>",
"transactionHash": "<string>",
"marketAddress": "<string>",
"baseTokenPriceUSD": 123,
"quoteTokenPriceUSD": 123,
"preBalanceBaseToken": "<string>",
"preBalanceQuoteToken": "<string>",
"postBalanceBaseToken": "<string>",
"postBalanceQuoteToken": "<string>",
"swapRecipient": "<string>",
"marketAddresses": [
"<string>"
],
"baseTokenMarketCapUSD": 123,
"quoteTokenMarketCapUSD": 123,
"labels": [],
"walletMetadata": {
"entityName": "<string>",
"entityLogo": "<string>",
"entityLabels": [
"<string>"
],
"entityType": "<string>",
"entityDescription": "<string>",
"entityTwitter": "<string>",
"entityWebsite": "<string>",
"entityGithub": "<string>",
"entityDiscord": "<string>",
"entityTelegram": "<string>",
"extra": {}
},
"baseToken": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"logo": "<string>",
"decimals": 123
},
"quoteToken": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"logo": "<string>",
"decimals": 123
},
"platform": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"totalFeesUSD": 123,
"gasFeesUSD": 123,
"platformFeesUSD": 123,
"mevFeesUSD": 123
}
],
"pagination": {
"count": 123,
"nextCursor": "<string>",
"hasMore": true,
"from": 123,
"to": 123
}
}Trades Data
Batch Download Trades
Batch download trades with filters by token, chain, and timeframe. Supports cursor-based pagination for downloading large datasets.
GET
/
2
/
trades
/
filters
Batch download trades with filters
curl --request GET \
--url https://demo-api.mobula.io/api/2/trades/filtersimport requests
url = "https://demo-api.mobula.io/api/2/trades/filters"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/trades/filters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.mobula.io/api/2/trades/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api.mobula.io/api/2/trades/filters"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/trades/filters")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/trades/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"operation": "regular",
"type": "buy",
"baseTokenAmount": 123,
"baseTokenAmountRaw": "<string>",
"baseTokenAmountUSD": 123,
"quoteTokenAmount": 123,
"quoteTokenAmountRaw": "<string>",
"quoteTokenAmountUSD": 123,
"date": 123,
"swapSenderAddress": "<string>",
"transactionSenderAddress": "<string>",
"blockchain": "<string>",
"transactionHash": "<string>",
"marketAddress": "<string>",
"baseTokenPriceUSD": 123,
"quoteTokenPriceUSD": 123,
"preBalanceBaseToken": "<string>",
"preBalanceQuoteToken": "<string>",
"postBalanceBaseToken": "<string>",
"postBalanceQuoteToken": "<string>",
"swapRecipient": "<string>",
"marketAddresses": [
"<string>"
],
"baseTokenMarketCapUSD": 123,
"quoteTokenMarketCapUSD": 123,
"labels": [],
"walletMetadata": {
"entityName": "<string>",
"entityLogo": "<string>",
"entityLabels": [
"<string>"
],
"entityType": "<string>",
"entityDescription": "<string>",
"entityTwitter": "<string>",
"entityWebsite": "<string>",
"entityGithub": "<string>",
"entityDiscord": "<string>",
"entityTelegram": "<string>",
"extra": {}
},
"baseToken": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"logo": "<string>",
"decimals": 123
},
"quoteToken": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"logo": "<string>",
"decimals": 123
},
"platform": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"totalFeesUSD": 123,
"gasFeesUSD": 123,
"platformFeesUSD": 123,
"mevFeesUSD": 123
}
],
"pagination": {
"count": 123,
"nextCursor": "<string>",
"hasMore": true,
"from": 123,
"to": 123
}
}Query Details
This endpoint allows batch downloading of trades across the entire platform with filtering capabilities. Ideal for:- Downloading all trades for a specific chain
- Downloading all trades involving a specific token
- Building historical trade datasets
- Analytics and backtesting
| Parameter | Required | Description |
|---|---|---|
from | Yes | Start of timeframe (Unix timestamp in ms or ISO 8601 date) |
to | Yes | End of timeframe (Unix timestamp in ms or ISO 8601 date) |
blockchain | No | Blockchain filter (e.g., “solana”, “base”, “ethereum”, “evm:1”) |
tokenAddress | No | Token address to filter by (matches token0 or token1) |
limit | No | Number of results per page (default: 1000, max: 5000) |
cursor | No | Cursor for pagination (from previous response’s nextCursor) |
sortOrder | No | Sort order: asc (default) or desc |
Timeframe Limit: The maximum timeframe between
from and to is 1 hour (3,600,000 ms). For longer periods, make multiple requests with sequential timeframes.Response Overview
The response uses the same trade format as/api/2/token/trades for consistency.
Pagination object:
- count: Number of trades returned in this response
- nextCursor: Cursor to use for fetching the next page (null if no more results)
- hasMore: Boolean indicating if more results are available
- from/to: Timestamps of the queried timeframe
- id: Unique swap identifier
- operation: Operation type (regular, deposit, withdrawal)
- type: Trade direction (buy, sell, deposit, withdrawal)
- baseTokenAmount/quoteTokenAmount: Token amounts (formatted)
- baseTokenAmountRaw/quoteTokenAmountRaw: Token amounts in smallest units
- baseTokenAmountUSD/quoteTokenAmountUSD: Trade value in USD
- baseTokenPriceUSD/quoteTokenPriceUSD: Token prices at execution time
- date: Trade timestamp in milliseconds
- blockchain: Human-readable blockchain name
- transactionHash: Transaction hash
- marketAddress: Pool/market address
- swapSenderAddress: Address that executed the swap
- transactionSenderAddress: Transaction originator (tx.from)
- swapRecipient: Actual beneficiary of the swap
- baseToken: Base token metadata (address, name, symbol, logo, decimals)
- quoteToken: Quote token metadata (address, name, symbol, logo, decimals)
- labels: Array of labels (sniper, bundler, insider, etc.)
- platform: Trading platform metadata (if available)
- totalFeesUSD/gasFeesUSD/platformFeesUSD/mevFeesUSD: Fee breakdown
Usage Examples
Download all Solana trades in a 1-hour window:curl -X GET "https://api.mobula.io/api/2/trades/filters?blockchain=solana&from=1706745600000&to=1706749200000&limit=5000" \
-H "Authorization: YOUR_API_KEY"
curl -X GET "https://api.mobula.io/api/2/trades/filters?tokenAddress=So11111111111111111111111111111111111111112&from=1706745600000&to=1706749200000&limit=5000" \
-H "Authorization: YOUR_API_KEY"
# First request
curl -X GET "https://api.mobula.io/api/2/trades/filters?blockchain=base&from=1706745600000&to=1706749200000&limit=5000"
# Next page using cursor from previous response
curl -X GET "https://api.mobula.io/api/2/trades/filters?blockchain=base&from=1706745600000&to=1706749200000&limit=5000&cursor=1706745612345:2847563921"
Sample Response
{
"data": [
{
"id": "2847563921",
"operation": "regular",
"type": "buy",
"baseTokenAmount": 150.25,
"baseTokenAmountRaw": "150250000",
"baseTokenAmountUSD": 150.25,
"quoteTokenAmount": 1.5,
"quoteTokenAmountRaw": "1500000000",
"quoteTokenAmountUSD": 150.25,
"date": 1706745612345,
"swapSenderAddress": "7yBt...sender",
"transactionSenderAddress": "7yBt...sender",
"swapRecipient": "7yBt...sender",
"blockchain": "Solana",
"transactionHash": "5xKp...abc123",
"marketAddress": "8xKp...pool123",
"baseTokenPriceUSD": 1.0,
"quoteTokenPriceUSD": 100.17,
"labels": [],
"baseToken": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://assets.coingecko.com/coins/images/6319/small/USD_Coin_icon.png",
"decimals": 6
},
"quoteToken": {
"address": "So11111111111111111111111111111111111111112",
"name": "Wrapped SOL",
"symbol": "SOL",
"logo": "https://assets.coingecko.com/coins/images/4128/small/solana.png",
"decimals": 9
},
"platform": {
"id": "raydium",
"name": "Raydium",
"logo": "https://..."
},
"totalFeesUSD": 0.15,
"gasFeesUSD": 0.001,
"platformFeesUSD": 0.149,
"mevFeesUSD": null
}
],
"pagination": {
"count": 5000,
"nextCursor": "1706745612345:2847563922",
"hasMore": true,
"from": 1706745600000,
"to": 1706749200000
}
}
Use
sortOrder=asc (default) for chronological batch downloads. This ensures consistent cursor-based pagination when downloading historical data.Base/Quote Token Logic: When filtering by
tokenAddress, that token becomes the base token. Without a token filter, token0 is used as base. The type field (buy/sell) is relative to the base token.Query Parameters
Available options:
asc, desc