Dune Analytics API
REST API for querying on-chain blockchain data via SQL. Users write queries in Dune's query editor (or the API) to analyze Ethereum, Solana, Base, Arbitrum, Optimism, Polygon, and 20+ other chains. Returns structured JSON results from pre-built community queries or custom SQL. Widely used for DeFi analytics, protocol dashboards, and on-chain research.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
HTTPS enforced. Single API key with no scope granularity. No OAuth. Data is all public on-chain data — no user PII risk. Key rotation not automated.
⚡ Reliability
Best When
You need rich historical and aggregated blockchain analytics via SQL, particularly for DeFi, protocol metrics, or wallet analysis across multiple chains without running your own indexer.
Avoid When
You need real-time block data, sub-second latency, or data from chains Dune doesn't support; or you don't have SQL expertise.
Use Cases
- • Query pre-built community analytics (e.g., total DEX volume, protocol TVL, wallet activity) via query execution API without writing SQL
- • Run custom SQL analytics on on-chain data for agent DeFi research pipelines (token flows, liquidity, MEV, whale activity)
- • Fetch time-series protocol metrics (daily active users, transaction counts, revenue) for agent portfolio analysis
- • Monitor specific wallet or contract activity by executing parametrized Dune queries with wallet addresses as parameters
- • Build agent dashboards that track DeFi protocol health metrics across multiple chains via the query results API
Not For
- • Real-time (block-level) data — Dune refreshes queries periodically, not block-by-block; use Helius or QuickNode for real-time RPC
- • Teams without SQL knowledge — queries require Spark SQL or DuneSQL syntax; non-SQL alternatives exist (The Graph, Covalent)
- • Private or non-indexed contract data — Dune covers decoded on-chain data only, not private data or off-chain events
Interface
Authentication
Single API key passed as X-DUNE-API-KEY header. No scopes — all endpoints accessible with any valid key. Keys generated in Dune account settings.
Pricing
Datapoints = cells of data returned. API access starts at Plus ($49/month). Community queries can be executed via API; creating/editing queries requires higher plans. Pricing changed significantly in 2024.
Agent Metadata
Known Gotchas
- ⚠ Query execution is asynchronous — agents must POST /execute, then poll GET /status/{execution_id} until state='QUERY_STATE_COMPLETED', then GET /results/{execution_id}; not a single synchronous call
- ⚠ Queries can take 30+ seconds for complex analytics — agents must implement polling with backoff, not expect immediate results
- ⚠ Results are paginated; max 1000 rows per page — agents processing large datasets must handle next_uri pagination
- ⚠ Datapoints quota can be exhausted quickly if agents re-execute the same query without using cached results (set max_age_hours parameter to reuse recent results)
- ⚠ Query parameters must be passed exactly as defined in the query; parameter names are case-sensitive
- ⚠ Community queries may be updated or deleted by their creators — agents relying on specific community queries should pin query IDs carefully
- ⚠ DuneSQL and Spark SQL syntax differ — queries written for one engine won't run on the other; check the query's engine before executing
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Dune Analytics API.
Scores are editorial opinions as of 2026-03-06.