Skip to main content
POST
Export a SQL query as a Parquet or CSV file
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.

Account id in every file

Every export file names the account it was made for:
  • Parquet: the file’s key-value metadata holds ironflow.account (your account id), ironflow.exported_at (UTC) and ironflow.licence. Readers show it as file metadata, for example pyarrow.parquet.ParquetFile(path).metadata.metadata; the rows are not changed.
  • CSV: the first line is a comment, # ironflow account <id>, exported <time>, licensed under https://ironflow.sh/terms, and the header row follows it. Skip it when you read the file, for example pandas.read_csv(path, skiprows=1).
Do not remove it from copies you keep while your plan runs.

Monthly bulk-row budget

Each plan has one budget of bulk rows per account for the UTC calendar month: Explorer 10,000,000, Builder 25,000,000, Pro 150,000,000, Enterprise no cap. The rows in each export file sent, /v1/query result rows and REST rows older than 7 days (/v1/fills, /v1/trades, /v1/liquidations) share it; REST reads of the last 7 days never count. A sent file reports what is left in X-Ironflow-Bulk-Rows-Remaining. When the budget is used up, or a query returns more rows than are left, the export answers 429 BULK_ROWS_MONTHLY_EXCEEDED with the limit, rows used and the reset in bulk_rows, and no file is written. Data from a monthly plan is licensed for use while the plan runs. Bulk exports may not be kept, or used to train or fine-tune machine-learning models, after the plan ends, and models trained or fine-tuned on them may be used only while the plan runs (Terms 15.5). For bulk history to keep without time limit, or to train models on, ask for a one-time data licence at hello@ironflow.sh.

Authorizations

Authorization
string
header
required

Ironflow API key, format if_xxxx. Free keys at https://ironflow.sh/key. Optional on read endpoints.

Body

application/json
sql
string
required

One read-only SQL statement, without a FORMAT clause.

Maximum string length: 20000
format
enum<string>
default:parquet

File format.

Available options:
parquet,
csv

Response

The file. Content-Disposition names it; X-Ironflow-Export-Rows and X-Ironflow-Export-Max-Rows give its size against the cap. Every file names the account it was made for, as Parquet key-value metadata (ironflow.account, ironflow.exported_at, ironflow.licence) or as a first CSV line starting with # ironflow account.

The response is of type file.