Dataset

Create a dataset by importing history instead of uploading it

Changed on

A 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).
post/datasets/imports

Request

  • Base URL: https://api.qtsurfer.net/v1
  • URL: https://api.qtsurfer.net/v1/datasets/imports
  • Auth: HTTP bearer

Request body

namestring required

A name unique among your datasets. 409 if already taken.

instrumentstring required

Exchange instrument identifier (e.g. a currency pair)

fromstring date-time required

Start of the range to fetch, inclusive. Must be before to.

tostring date-time required

End of the range to fetch, exclusive. The total span is capped by your tier — a request wider than that ceiling is 400, regardless of source type.

cadence'1s' | '1m' | '5m'

Optional. Omitted/blank keeps native per-trade event cadence — each swap at its own timestamp, so the resulting version's cadence is rt unless the swaps happen to sit on a fixed grid (see DatasetVersion.cadence). Set to 1s, 1m or 5m instead to get pre-aggregated candles at that width rather than raw trades (the resulting dataset's type becomes klines); any other value is 400. Not every network supports every cadence — an unsupported combination fails asynchronously, not at request time (see DatasetImportState.error).

type'dex' required

The source to fetch from. dex is the only value today.

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

datasetIdstring required

Opaque id of the newly created dataset — same id space as POST /datasets.

importIdstring required

Identifies this import. Pass to GET /datasets/{datasetId}/imports/{importId} to poll it — there is no separate "finalize" step the way an upload has.

jobIdstring required

The fetch/ingest job id.

status'fetching' required

Always fetching in this response — the fetch has only just 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 1m enum value to the request property

    • info

      added the new 1s enum value to the request property

    • info

      added the new 5m enum value to the request property

    • info

      added the new ethereum enum value to the request property /

    • info

      added the new robinhood enum value to the request property /

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      the request property / became optional