API reference
Query
Execute SQL
Run one read-only SQL statement over the index and get rows back synchronously — no execution id or polling. A single SELECT / WITH only; writes, DDL and multi-statement SQL are rejected.
POST/query
Try it Requires an API key —
Authorization: Bearer <API_KEY>. Costs 5 credits per call; rate limits apply per plan.Queries run as a read-only (SELECT-only) role with a statement timeout and a hard row cap. Writes, DDL and multi-statement SQL are rejected. Row results are clamped to your plan's row cap.
Headers
AuthorizationstringrequiredBearer <API_KEY> — create a key in your dashboard.
Content-Typestringrequiredapplication/json
Body
sqlstringrequiredA single read-only SELECT or WITH statement over tables like tokens, token_stats, swaps, transfers, balances, pools, blocks, pool_minute_version, momentum_snapshot.
limitintegeroptionalMax rows; clamped to your plan's row cap (Free = 200) and a hard cap of 10,000.
Response · 200
columnsstring[]optionalColumn names, in order.
rowsobject[]optionalResult rows, keyed by column name.
row_countintegeroptionalRows returned.
cappedbooleanoptionalTrue if truncated by the row cap.
elapsed_msintegeroptionalServer execution time (ms).
Errors
400Not a single SELECT/WITH, or writes / DDL / multi-statement SQL.401Missing or invalid API key.429Plan rate limit exceeded — back off per the Retry-After header.5xxServer/index error; safe to retry with backoff.POST
/queryRequest
curl -X POST https://data.amonhen.com/app/api/query \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"sql":"select symbol, volume_24h from token_stats ts join tokens t on t.address = ts.token order by volume_24h desc nulls last limit 10","limit":10}'Response · example
{
"columns": ["symbol", "volume_24h"],
"rows": [ { "symbol": "WETH", "volume_24h": 218500000 } ],
"row_count": 1,
"capped": false,
"elapsed_ms": 128
}