Access Dune’s blockchain data from your favorite BI tools and clients using the DuneSQL Trino/Presto connector. It’s a more convenient way to use Dune outside of Dune with any tool that supports Trino, Presto, or Starburst connectors.
Architecture diagram: Trino/Presto client → Dune connector → Dune Query Engine

Trino/Presto client → Dune connector → Dune Query Engine

Compatible Tools

Use any tool that supports Trino, Presto, or Starburst connectors. Popular choices include:

Connection Parameters

Use these values in your Trino, Presto, or Starburst client configuration:
ParameterValueDescription
Hostdune-api-trino.dune.comDune’s Trino/Presto endpoint
Port443Standard HTTPS port
UsernameduneFixed username for all connections
Password<your-dune-api-key>Your Dune API key
Catalogdelta_prodMain data catalog
SSL/TLStrueAlways use encrypted connections
HTTP schemehttpsRequired for secure connections
If you need an API key, see our guide on Authentication. Remember to keep your API keys secret and rotate them immediately if they are ever exposed.

Hex Setup for Dune

Follow these steps to connect Dune as a data source in your Hex workspace.

Add the Data Connection

1

Open Data sources

Under Workspace settings, select Data sources.
Hex step 1: Open Data sources
2

Add connection and choose Trino

Click the green + Connection button, then select Trino from the list of available connections.
Hex step 2: Add connection and choose Trino
3

Enter connection details

Fill in the form fields using the values from the Connection Parameters section.
Hex step 3: Enter connection details

Run a Test Query

Once your data source is configured, you can query it directly from any Hex project.
1

Open or create a project

Open an existing project or create a new one.
2

Add a SQL cell

Add a new SQL cell to your notebook.
3

Select data source

In the data source dropdown at the top of the cell, select your newly created Dune SQL connection.
4

Paste and run SQL

Paste the example query below into the cell and run it.
Hex step: Paste and run SQL
You can use this query to test your connection. It fetches the daily transaction count from the last year on Base.
SELECT
  date_trunc('day', block_time) AS time,
  count(*) AS count
FROM base.transactions
WHERE block_time > now() - interval '12' month
GROUP BY 1
ORDER BY 1 DESC

Metabase Setup for Dune

Follow these steps to connect Dune as a data source in Metabase.

Add the Database Connection

1

Open Admin settings

From the Metabase home page, click the Settings gear icon in the top-right corner. Select Admin settings from the dropdown menu.
Metabase step 1: Open Admin settings
2

Go to Databases

In the Admin panel, navigate to the Databases tab.
Metabase step 2: Go to Databases
3

Add database

Click the blue Add database button to open the configuration modal.
Metabase step 3: Add database
4

Choose driver

In the modal, select Starburst (Trino) as the Database type.
5

Enter connection details

Fill in the form fields using the values from the Connection Parameters section. For best performance in Metabase, we recommend disabling Rerun queries for simple explorations and Periodically refingerprint tables in the advanced settings.
Schema discovery queries such as SHOW TABLES or SHOW SCHEMAS may not be available in Metabase with this connector because Dune’s catalog spans millions of tables. Many BI tools are not yet optimized to enumerate catalogs at this scale. An update with improved schema discovery is planned for the future.

Run a Test Query

After configuring and saving the connection, you can run a query to verify that everything is working.
1

Create a new SQL query

Click the + New button and select SQL query.
2

Select database

In the editor, choose your newly created Dune SQL data source from the Select a database dropdown.
3

Paste example SQL

Paste the example query below into the editor.
4

Run the query

Run the query to verify the connection.
You can use this query to test your connection. It fetches the daily transaction count from the last year on Base.
SELECT
  date_trunc('day', block_time) AS time,
  count(*) AS count
FROM base.transactions
WHERE block_time > now() - interval '12' month
GROUP BY 1
ORDER BY 1 DESC

Using Trino SDKs directly in your code

Connect to Dune using Trino SDKs in your preferred language.
# Install: brew install trino
trino --server https://dune-api-trino.dune.com:443 \
  --user dune --password \
  --catalog delta_prod \
  --schema runtime \
  --execute "SELECT count(*) FROM base.transactions WHERE block_time > now() - interval '1' day"

Supported SQL Operations

Queries executed via the connector align with what you can run on the Dune platform. See the Query Engine overview for more information on supported functions and syntax.

Rate Limits

Rate limits for the connector mirror those of the Dune Analytics API. Please refer to the Rate Limits documentation for details.

Billing & Cost

All queries run via the connector are executed on the Medium Query Engine and cost 10 Dune Credits per execution. In addition, fetching results consumes credits proportional to the number of datapoints returned. For a full breakdown, please see our documentation on Billing.

Limitations

The connector currently has limited support for metadata discovery queries such as SHOW TABLES or SHOW SCHEMAS. This may impact the data source browsing and autocomplete experience within some BI tools. For schema and table discovery, see the Data Explorer guide. If you encounter timeouts with large result sets, consider paginating your queries using LIMIT and OFFSET, narrowing your filters, or splitting complex queries into smaller, more manageable parts.