dune-client
A simple framework for interacting with Dune Analytics official API service.
What it is and what it does
dune-client is a Python wrapper around Dune Analytics' official REST API, designed to let you run SQL queries against blockchain data and retrieve results programmatically. It handles authentication, query parameterization (text, number, date, enum types), and result formatting—you can fetch results as JSON, CSV, or Pandas DataFrames. The package also supports advanced features like fetching cached results without re-running queries, and for paid subscribers, full CRUD operations to create, update, archive, and manage queries directly from Python.
The library is built on standard HTTP clients (aiohttp and requests) and JSON serialization tools, making it straightforward to integrate into data pipelines, analytics scripts, or automated reporting workflows. It requires Python 3.11 or later and is actively maintained by the Dune Analytics team.
Use it for:
- Run parameterized SQL queries against Ethereum and other blockchain data without leaving Python.
- Fetch cached query results to avoid re-execution costs when data freshness allows.
- Build automated dashboards or reports that pull on-chain metrics into Pandas DataFrames.
- Programmatically manage a library of Dune queries (create, update, archive) as part of a data pipeline.
- Integrate blockchain data retrieval into Python applications that need real-time or periodic on-chain metrics.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client for querying and managing Dune Analytics queries via their official API, supporting parameterized queries, result retrieval in multiple formats, and CRUD operations on queries.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and is the official client for Dune's API. Install it if you need to query Dune Analytics from Python; the main prerequisite is a valid API key and an active Dune account.
Install
dune-client on PyPI
pip
pip install dune-clientuv
uv add dune-clientpoetry
poetry add dune-clientInstalling dune-client
Before you install
Low friction install with six straightforward dependencies. The package is actively maintained with a release within the last 10 days and supports current Python versions (3.11–3.14).
License in practice
Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects as long as you include the license notice.
Quickstart
pip install dune-client
from dune_client.client import DuneClient
from dune_client.types import QueryParameter
from dune_client.query import QueryBase
dune = DuneClient()
query = QueryBase(name="Sample", query_id=1215383)
results = dune.run_query(query)
Requires a valid DUNE_API_KEY environment variable to authenticate with the Dune Analytics API.
Verify before relying
- Rate limits or throttling behavior on the Dune API when running frequent queries.
- Whether paid subscription features (CRUD operations, query creation) are fully functional in all environments.
- Performance characteristics when handling large result sets or complex parameterized queries.
Package facts
| License | Apache License Version 2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — aiohttp, dataclasses-json, deprecated, ndjson, python-dateutil, requests |
| Maintenance | actively maintained — 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 218,272/month — #9,342 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dune_client-1.11.4-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
wolframalphaProvides a Python client for querying the…
permissive · top 15,000 on PyPI
yandex-query-clientHTTP client for submitting SQL queries to…
permissive · top 5,000 on PyPI
pyspark-clientPython client for connecting to Apache Spark…
permissive · top 5,000 on PyPI
pysparkPySpark provides Python bindings to Apache…
permissive · top 1,000 on PyPI
bigframesBigFrames provides a pandas-compatible…
permissive · top 5,000 on PyPI
pandasqlpandasql lets you query pandas DataFrames using…
unclear · top 5,000 on PyPI
stellar-sdkStellar SDK provides Python APIs to build and…
permissive · top 15,000 on PyPI
datafusionDataFusion is a Python binding to Apache…
permissive · top 5,000 on PyPI
ponyPony is an object-relational mapper that lets…
permissive · top 15,000 on PyPI
segment-analytics-pythonA Python client for sending analytics events to…
permissive · top 5,000 on PyPI