Structured Query
/gateway/v1/onchain/querySend a JSON object describing the query. Example: `{"source":"agent.ethereum_dex_trades","fields":["block_time"],"filters":[{"field":"block_date","op":"gte","value":"2025-03-01"}],"limit":1}`.
Use this endpoint when you want structured filtering without writing raw SQL. Discover tables and columns first with `GET /v1/onchain/schema`.
Key rules: - Source format: `agent.<table_name>` - Max 10,000 rows (default 20), 30s timeout - Always filter on `block_date` for large tables - Never filter by `symbol` — it is unindexed (full scan). To resolve a ticker to a contract address, use `GET /v1/search/token?q={symbol}&chain={chain}` and filter by `contract_address` instead - For transfer tables, `amount` is decimal-adjusted display units; `amount_raw` is the original base-unit value
Data refresh: ~24 hours.
Example
```json { "source": "agent.ethereum_dex_trades", "fields": ["block_time", "project", "token_pair", "amount_usd", "taker"], "filters": [ {"field": "block_date", "op": "gte", "value": "2025-03-01"}, {"field": "project", "op": "eq", "value": "uniswap"}, {"field": "amount_usd", "op": "gte", "value": 100000} ], "sort": [{"field": "amount_usd", "order": "desc"}], "limit": 20 } ```
Query Parameters
A URL to the JSON Schema for this object.
https://example.com/schemas/StructuredQuery.jsonColumns to return. Omit to return all columns.
["project","symbol","apy","tvl_usd"]WHERE conditions (ANDed together)
Max rows to return. Default 20, max 10000
20Rows to skip for pagination. Default 0
0ORDER BY clauses
Fully-qualified table name like `agent.ethereum_yields_daily`. Use GET /v1/onchain/schema for available tables.
agent.ethereum_yields_daily