Skip to main content
POST
/
gateway
/
v1
/
onchain
/
sql
Blockchain SQL Query
curl --request POST \
  --url https://api.ask.surf/gateway/v1/onchain/sql \
  --header 'Content-Type: application/json' \
  --data '
{
  "sql": "<string>",
  "max_rows": 1000
}
'
{
  "data": [
    {}
  ],
  "meta": {
    "cached": true,
    "credits_used": 123,
    "limit": 123,
    "offset": 123,
    "total": 123
  },
  "$schema": "<string>"
}

Body

application/json
sql
string
required

SQL query to execute against the blockchain data warehouse

Example:

"SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5"

max_rows
integer<int64>
default:1000

Maximum number of rows to return

Required range: 1 <= x <= 10000
Example:

1000

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"