# Dune (/docs/nodes/data/dune)

Execute SQL queries and retrieve blockchain analytics via Dune.



Dune provides SQL-based blockchain analytics. The Dune node lets you execute existing queries, check execution status, and retrieve results programmatically.

Prerequisites [#prerequisites]

* Dune API key ([dune.com/settings/api](https://dune.com/settings/api))
* Requires Plus plan or higher for API access
* Add as a credential in [Credentials](/docs/credentials/adding)

Operations [#operations]

| Operation           | Description                              | Key inputs                            |
| ------------------- | ---------------------------------------- | ------------------------------------- |
| getQueryResults     | Get cached results for a query           | queryId, limit                        |
| executeQuery        | Execute a query with optional parameters | queryId, queryParameters, performance |
| getExecutionStatus  | Check status of a running execution      | executionId                           |
| getExecutionResults | Get results from a completed execution   | executionId, limit                    |
| cancelExecution     | Cancel a running execution               | executionId                           |

Configuration [#configuration]

| Field           | Type   | Required          | Description                                   |
| --------------- | ------ | ----------------- | --------------------------------------------- |
| queryId         | string | For query ops     | Dune query ID (numeric)                       |
| executionId     | string | For execution ops | Execution ID from executeQuery                |
| queryParameters | string | No                | JSON string of query parameters               |
| performance     | string | No                | `medium` or `large` (default: `medium`)       |
| limit           | number | No                | Max rows to return (default: 100, max: 10000) |
| offset          | number | No                | Row offset for pagination                     |

Output [#output]

All operations return the standard envelope:

```json
{
  "success": true,
  "operation": "getQueryResults",
  "queryId": "1234567",
  "data": { /* raw Dune response */ }
}
```

Query-result operations expose rows under `data.result.rows`. Reference fields downstream with the response name (default `duneResponse`), for example `{duneResponse.data.result.rows[0].volume_usd}`. Execution-state operations (`getExecutionStatus`, `getExecutionResults`, `cancelExecution`, `executeQuery`) echo `executionId` instead of `queryId`.

Common use cases [#common-use-cases]

* Run scheduled blockchain analytics queries
* Feed Dune data into AI for automated reporting
* Monitor specific on-chain metrics via custom SQL

Next steps [#next-steps]

* [CoinGecko](/docs/nodes/data/coingecko) - pre-built market data endpoints
* [Helius](/docs/nodes/data/helius) - real-time on-chain data
