Run any Dune Analytics query and return live onchain results by query ID. Use fast_only=True for live bots — returns cached result instantly or raises immediately, never blocks..
You need deep onchain analytics from a specific Dune query — protocol revenue, user counts, custom metrics.
| name | type | required | description |
|---|---|---|---|
limit | integer | no | Maximum rows to return (default 25) |
query_id | integer | yes | Dune Analytics query ID (visible in the query URL) |
query_parameters | object | no | Optional named parameters to pass to the Dune query |
rows[], columns[], row_count, generated_at from the Dune Analytics query result
{
"query_id": 3810512,
"row_count": 2,
"columns": [
"protocol",
"revenue_usd"
],
"rows": [
{
"protocol": "Uniswap V3",
"revenue_usd": 1243800.0
},
{
"protocol": "Aave V3",
"revenue_usd": 987200.0
}
],
"generated_at": "2026-03-22T00:00:00Z",
"source": "dune"
}
curl -X POST https://agentpay.tools/tools/dune_query/call \
-H 'Content-Type: application/json' \
-d '{"parameters": {"query_id": "Dune Analytics query ID (visible in the query URL)"}, "agent_address": "<your wallet or any identifier>"}'
from agentpay import quickstart # pip install agentpay-x402
s = quickstart(max_spend=0.10) # hard budget cap; mints a wallet, no funding needed
r = s.call("dune_query", {"query_id": "Dune Analytics query ID (visible in the query URL)"})
print(r.data) # + r.cost, r.tx, r.network — full receipt
npx -y @romudille/agentpay-mcp # keyless; exposes dune_query to any MCP agent runtime