Query Dataset
POST
/v1/datasets/{dataset_id}/query
const url = 'https://example.com/v1/datasets/example/query';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"sql":"SELECT * FROM data","offset":0,"limit":100}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/datasets/example/query \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "sql": "SELECT * FROM data", "offset": 0, "limit": 100 }'Run one DuckDB SELECT over the table data, the dataset, and return a page of its rows,
e.g. SELECT * FROM data WHERE stars = 1 ORDER BY review LIMIT 20. It can read nothing but the
dataset. agree([a, b, …]) and disagree([a, b, …]) compare columns in a row; see
POST /v1/datasets/{id}/compare.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”dataset_id
required
Dataset Id
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
QueryRequest
object
sql
Sql
One DuckDB SELECT over the table data.
string
offset
Offset
integer
limit
Limit
Rows to return; the query’s own LIMIT caps the total.
integer
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
QueryResult
object
columns
required
Columns
What the query returns, which needn’t be the dataset’s.
Array<object>
Columnobject
name
required
Name
string
type
required
Type
string
rows
required
Rows
Array<object>
object
key
additional properties
any
total
required
Total
Rows the query returns, ignoring offset and limit.
integer
Example generated
{ "columns": [ { "name": "example", "type": "example" } ], "rows": [ {} ], "total": 1}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}