Skip to content
getgeolens.com

Run a read-only SQL query

POST
/query/
curl --request POST \
--url https://example.com/query/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "sql": "example", "restrict_tables": [ "example" ], "row_limit": 100 }'

Execute one SELECT through the read-only SQL sandbox.

The statement must be a single SELECT over data.* tables you can access, name every table in restrict_tables, and fit the sandbox’s function allowlist and cost bounds. Rows are capped by row_limit and execution by a server-side statement timeout.

Media type application/json
SandboxQueryRequest

One read-only SELECT plus its mandatory table scope.

object
sql
required
Sql

A single SELECT statement over data.* tables.

string
>= 1 characters <= 20000 characters
restrict_tables
required
Restrict Tables

Table names (without the data. prefix) the query may touch. Required and non-empty; intersected with your access — it can only narrow what you already see, never widen it.

Array<string>
>= 1 items <= 25 items
row_limit
Row Limit

Maximum rows to return.

integer
default: 100 >= 1 <= 1000

Successful Response

Media type application/json
SandboxResult

Structured result from sandbox query execution.

Uses list-of-lists for rows (not list-of-dicts) for serialization performance.

object
rows
required
Rows
Array<Array>
columns
required
Columns
Array<string>
row_count
required
Row Count
integer
truncated
required
Truncated
boolean
Example generated
{
"rows": [
[
"example"
]
],
"columns": [
"example"
],
"row_count": 1,
"truncated": true
}

Bad request — invalid query parameters or payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}