Dune Analytics API
Dune Analytics API
Dune Analytics API lets developers programmatically execute SQL queries on indexed on-chain data for Ethereum / Polygon / Arbitrum / Solana / etc.
Familiar SQL instead of GraphQL for on-chain data
Query latency (complex queries: seconds to minutes)
Sign up at dune.com for an API key. Write SQL on the website to get a query ID, POST /v1/query/{queryId}/execute to run, GET /v1/execution/{executionId}/results for results.
Uptime · 30-day window
About this API
Dune Analytics is an on-chain analytics platform founded 2018, positioned as "SQL on blockchain". Background: on-chain data is public but hard to query directly with SQL (raw data is binary event logs). Dune team indexes all major chains' data into relational tables (ethereum.transactions, uniswap_v3.swaps, etc.); analysts write standard SQL for complex queries. Dune's website has 1M+ community-shared queries and dashboards — all popular DeFi protocols (Uniswap, Aave, Curve) have official dashboards showing DAU, TVL, revenue, and core metrics. Dune API programmatizes these queries — e.g. daily auto-trigger to fetch latest TVL data to your own dashboard.
What you can build
- 1DeFi protocol dashboards (TVL, revenue, user activity)
- 2Web3 project KPI automated reports
- 3On-chain behavior research
- 4Quant research inputs
Strengths & limitations
Strengths
- Familiar SQL instead of GraphQL for on-chain data
- Pre-indexed data (no ETL required)
- Rich existing dashboard templates (Dune community has 1M+ public queries)
Limitations
- Query latency (complex queries: seconds to minutes)
- Free tier credits insufficient for commercial
- Mainly for analysts, not suitable for real-time trading
Example request
curl https://dune.com/<endpoint> \
-H "Authorization: Bearer $API_KEY"
# Some providers use X-Api-Key instead — verify in the docs.Getting started
Sign up at dune.com for an API key. Write SQL on the website to get a query ID, POST /v1/query/{queryId}/execute to run, GET /v1/execution/{executionId}/results for results.
FAQ
How real-time is it?+
Not real-time — indexed data typically has 5-10 min delay. For real-time, use RPC nodes or Subgraph.
How are credits calculated?+
By compute resources consumed. Simple queries: 1-10 credits. Complex multi-year aggregations: hundreds of credits.
Technical details
- Auth type
- api_key
- Pricing
- freemium
- Rate limit
- 免费 1000 credits/月(每个查询根据复杂度消耗 credits)
- Protocols
- REST
- SDKs
- python, typescript, go
- Response time
- 301 ms
- Last health check
- 5/12/2026, 7:37:19 AM