Export a SQL query as a Parquet or CSV file
curl --request POST \
--url https://api.ironflow.sh/v1/query/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"sql": "SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')",
"format": "parquet"
}
EOFimport requests
url = "https://api.ironflow.sh/v1/query/export"
payload = {
"sql": "SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')",
"format": "parquet"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sql: 'SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = \'BTC-PERP\' AND ts >= toDate(\'2026-10-15\') AND ts < toDate(\'2026-10-16\')',
format: 'parquet'
})
};
fetch('https://api.ironflow.sh/v1/query/export', 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://api.ironflow.sh/v1/query/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sql' => 'SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = \'BTC-PERP\' AND ts >= toDate(\'2026-10-15\') AND ts < toDate(\'2026-10-16\')',
'format' => 'parquet'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ironflow.sh/v1/query/export"
payload := strings.NewReader("{\n \"sql\": \"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')\",\n \"format\": \"parquet\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ironflow.sh/v1/query/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sql\": \"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')\",\n \"format\": \"parquet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ironflow.sh/v1/query/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sql\": \"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')\",\n \"format\": \"parquet\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}{
"error": {
"code": "TIER_LIMIT",
"message": "SQL file export (Parquet or CSV) needs a paid plan: Explorer or Builder, see the upgrade object. The free datasets cover whole-market history: https://ironflow.sh/datasets",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "SQL export to Parquet or CSV (1,000,000 rows a file), 100 requests a minute, 90 days of history",
"limit": "tier",
"lifts": "unlocked by Explorer",
"url": "https://ironflow.sh/upgrade?utm_source=api&plan=explorer&limit=tier",
"how": "POST https://api.ironflow.sh/v1/billing/upgrade with your email, wallet, plan and network, then send the USDC"
}
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}SQL
Export SQL results as Parquet or CSV
POST /v1/query/export runs read-only SQL over Ironflow’s Hyperliquid tables and returns a Parquet or CSV file, on Explorer and Builder plans.
POST
/
v1
/
query
/
export
Export a SQL query as a Parquet or CSV file
curl --request POST \
--url https://api.ironflow.sh/v1/query/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"sql": "SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')",
"format": "parquet"
}
EOFimport requests
url = "https://api.ironflow.sh/v1/query/export"
payload = {
"sql": "SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')",
"format": "parquet"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sql: 'SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = \'BTC-PERP\' AND ts >= toDate(\'2026-10-15\') AND ts < toDate(\'2026-10-16\')',
format: 'parquet'
})
};
fetch('https://api.ironflow.sh/v1/query/export', 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://api.ironflow.sh/v1/query/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sql' => 'SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = \'BTC-PERP\' AND ts >= toDate(\'2026-10-15\') AND ts < toDate(\'2026-10-16\')',
'format' => 'parquet'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ironflow.sh/v1/query/export"
payload := strings.NewReader("{\n \"sql\": \"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')\",\n \"format\": \"parquet\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ironflow.sh/v1/query/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sql\": \"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')\",\n \"format\": \"parquet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ironflow.sh/v1/query/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sql\": \"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = 'BTC-PERP' AND ts >= toDate('2026-10-15') AND ts < toDate('2026-10-16')\",\n \"format\": \"parquet\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}{
"error": {
"code": "TIER_LIMIT",
"message": "SQL file export (Parquet or CSV) needs a paid plan: Explorer or Builder, see the upgrade object. The free datasets cover whole-market history: https://ironflow.sh/datasets",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "SQL export to Parquet or CSV (1,000,000 rows a file), 100 requests a minute, 90 days of history",
"limit": "tier",
"lifts": "unlocked by Explorer",
"url": "https://ironflow.sh/upgrade?utm_source=api&plan=explorer&limit=tier",
"how": "POST https://api.ironflow.sh/v1/billing/upgrade with your email, wallet, plan and network, then send the USDC"
}
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"upgrade": {
"plan": "explorer",
"price_usdc": 49,
"days": 30,
"unlocks": "<string>",
"limit": "rate",
"lifts": "60 requests a minute now, 100 on Explorer",
"url": "<string>",
"how": "<string>",
"buy_url": "<string>",
"pay_per_call": {},
"offer": "<string>"
},
"get_key": {
"method": "POST",
"url": "https://api.ironflow.sh/v1/keys",
"body": {
"email": "[email protected]"
},
"page": "<string>"
},
"dataset": {
"name": "Hyperliquid Liquidations",
"url": "https://huggingface.co/datasets/ironflow/hyperliquid-liquidations?utm_source=api",
"holds": "every liquidation",
"from": "2025-05-25",
"through": "2026-10-31"
},
"ironbox": {
"why": "No rate limits inside an Ironbox: your agent runs next to Hyperliquid with the data on the box.",
"create": "POST https://api.ironflow.sh/v1/ironbox",
"url": "https://ironflow.sh/ironbox?utm_source=api"
},
"stream": "GET https://api.ironflow.sh/v1/liquidations/stream (no daily limit for keyless streams)",
"allowed_from": 1794394800000,
"did_you_mean": [
"xyz:GOLD-PERP",
"PAXG-PERP"
]
}
}For whole-market history you may not need this: the free datasets are one download. Use export for what they do not hold, such as every fill with fees and PnL, per-wallet tables, sub-hourly marks and custom filters.
curl -sS https://api.ironflow.sh/v1/query/export \
-H "Authorization: Bearer $IRONFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT ts, tid, side, price, size, notional FROM hl.trades WHERE market = \'BTC-PERP\' AND ts >= toDate(\'2026-10-15\') AND ts < toDate(\'2026-10-16\')","format":"parquet"}' \
-o btc-2026-10-15.parquet
Authorizations
Ironflow API key, format if_xxxx. Free keys at https://ironflow.sh/key. Optional on read endpoints.
Body
application/json
Response
The file. Content-Disposition names it; X-Ironflow-Export-Rows and X-Ironflow-Export-Max-Rows give its size against the cap.
The response is of type file.