Skip to main content
POST
/
gateway
/
v1
/
onchain
/
query
Blockchain Structured Query
curl --request POST \
  --url https://api.ask.surf/gateway/v1/onchain/query \
  --header 'Content-Type: application/json' \
  --data '
{
  "source": "<string>",
  "fields": [
    "<string>"
  ],
  "filters": [
    {
      "field": "<string>",
      "op": "<string>",
      "value": "<unknown>"
    }
  ],
  "limit": 123,
  "offset": 123,
  "sort": [
    {
      "field": "<string>",
      "order": "<string>"
    }
  ]
}
'
{
  "data": [
    {}
  ],
  "meta": {
    "cached": true,
    "credits_used": 123,
    "limit": 123,
    "offset": 123,
    "total": 123
  },
  "$schema": "<string>"
}

Body

application/json
source
string
required

Fully-qualified table name like agent.my_table

Example:

"agent.my_table"

fields
string[] | null

Columns to return. Omit to return all columns. Example for agent.ethereum_transactions: [transaction_hash, from_address, value]

Example:
["transaction_hash", "from_address", "value"]
filters
object[] | null

WHERE conditions (ANDed together)

limit
integer<int64>

Max rows to return. Default 20, max 10000

Example:

20

offset
integer<int64>

Rows to skip for pagination. Default 0

Example:

0

sort
object[] | null

ORDER BY clauses

Response

OK

data
object[] | null
required
meta
object
required
$schema
string<uri>

A URL to the JSON Schema for this object.

Example:

"https://example.com/schemas/DataResponseOnchainRow.json"