Create a dataset by importing history instead of uploading it
Changed onA second way to get data into a dataset, alongside POST /datasets: instead of PUTting a file yourself, ask the API to go fetch history on your behalf. Creates the dataset and starts the fetch in the same call — there is no separate upload step, and the result lands as a dataset version indistinguishable from an uploaded one once it's ready. Poll GET /datasets/{datasetId}/imports/{importId} for progress.
type selects the source. dex — history over a pool/pair's own on-chain market — is the only value today; other source types join this same endpoint later.
A dex import has two data shapes, chosen by the top-level cadence:
- Omitted/blank (default) — on-chain swap history, replayed directly from the pool/pair's own chain. Cadence is native, not resampled: each swap keeps the timestamp it happened at rather than being bucketed into candles, so the resulting version's cadence is rt unless the swaps happen to sit on a fixed grid (see DatasetVersion.cadence).
- One of 1s / 1m / 5m — pre-aggregated candles at that width instead of raw trades. The resulting dataset's type is klines, not ticker. Not every network supports every cadence yet — an unsupported combination fails asynchronously, same as an unresolvable pool (see the failed status on the poll endpoint below).
Request
- Base URL: https://api.qtsurfer.net/v1
- URL: https://api.qtsurfer.net/v1/datasets/imports
- Auth: HTTP bearer
Request body
Example request
{
"name": "weth-usdc-week",
"instrument": "BTC/USDT",
"from": "2026-08-01T00:00:00Z",
"to": "2026-08-08T00:00:00Z",
"type": "dex",
"dex": {
"network": "ethereum",
"id": "uniswap",
"version": "v3",
"contract": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"
}
}Response
Dataset created, fetch started
Example response
{
"datasetId": "ds_3f9a1c2e7b0d4a5f",
"importId": "imp_01j9z1x2y3z4a5b6c7d8e9f0g1",
"jobId": "dataset-import:00000000-.../ds_3f9a1c2e7b0d4a5f:imp_01j9z1x2y3z4a5b6c7d8e9f0g1",
"status": "fetching"
}Changes
- breaking
request property
was restricted to a list of enum values - breaking
request property
/was restricted to a list of enum values - warning
removed the request property
/ - warning
removed the request property
/ - info
added the new optional request property
/ - info
added the new
1menum value to the request property - info
added the new
1senum value to the request property - info
added the new
5menum value to the request property - info
added the new
ethereumenum value to the request property/ - info
added the new
robinhoodenum value to the request property/
- breaking
- info
added the new optional request property
/ - info
added the new optional request property
/ - info
the request property
/became optional
- info