GET
/
v1
/
query
/
{queryId}
curl --request GET \
  --url https://api.dune.com/api/v1/query/{queryId} \
  --header 'X-DUNE-API-KEY: <x-dune-api-key>'
{
  "description": "Calculate the average dex volume",
  "is_archived": false,
  "is_private": true,
  "is_unsaved": false,
  "name": "My Query",
  "owner": "dune",
  "parameters": [
    {
      "description": "<string>",
      "enumFromResults": {
        "columnName": "<string>",
        "queryId": 123
      },
      "enumOptions": [
        "<string>"
      ],
      "isFreeformAllowed": true,
      "isMultiselect": true,
      "key": "<string>",
      "type": "<string>",
      "value": "<string>",
      "values": [
        "<string>"
      ]
    }
  ],
  "query_engine": "medium",
  "query_id": 123,
  "query_sql": "SELECT * FROM dex.trades",
  "tags": [
    "<string>"
  ],
  "version": 1
}

To access Query endpoints, a Plus plan or higher is required.

curl --request GET \
  --url https://api.dune.com/api/v1/query/{queryId} \
  --header 'X-DUNE-API-KEY: <x-dune-api-key>'

Headers

X-Dune-Api-Key
string
required

API Key for the service

Path Parameters

queryId
integer
required

Query ID

Query Parameters

api_key
string

API Key, alternative to using the HTTP header X-Dune-Api-Key

Response

200
application/json
OK
description
string

The description of the query

Example:

"Calculate the average dex volume"

is_archived
boolean

Indicates if the query is archived. Archived queries cannot be executed.

Example:

false

is_private
boolean

Indicates if the query is private.

Example:

true

is_unsaved
boolean

Indicates if the query is unsaved.

Example:

false

name
string

The name of the query

Example:

"My Query"

owner
string

username or team handle

Example:

"dune"

parameters
object[]

The parameters that can modify the execution of the sql.

query_engine
string

The query engine used to execute the query.

Example:

"medium"

query_id
integer

The unique ID of the query

Example:

123

query_sql
string

The SQL query text.

Example:

"SELECT * FROM dex.trades"

tags
string[]

Tags associated with the query.

version
integer

Version of the query, gets incremented every time the query is updated.

Example:

1