Table Schema

GET/gateway/v1/onchain/schema

Discover tables and columns before writing SQL or structured queries. Example: call this endpoint first, then use `agent.ethereum_dex_trades` in `/v1/onchain/query` or `/v1/onchain/sql`.

The response includes database name, table name, column names, types, and comments.

For transfer tables, `amount` is decimal-adjusted display units and `amount_raw` is the original base-unit value.

Table Schema
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/onchain/schema', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/DataResponseOnchainSchemaTable.json",
  "data": [
    {
      "columns": [
        {
          "comment": "<string>",
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "database": "<string>",
      "table": "<string>"
    }
  ],
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>",
    "has_more": true,
    "limit": 123,
    "offset": 123,
    "total": 123,
    "watermark": 123
  }
}