v1

latestOpenAPI 3.0.12026-07-22367385.5 KB

Returns the details of a query on Dune

This API allows for anyone to read the sql text, parameters, name, tags, and state of a query. For private queries, only the API key generated under the context of the owner of that query will work.

get/v1/query/{queryId}

Path parameters

queryIdinteger required

Query ID

Query parameters

api_keystring

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

Headers

X-Dune-Api-Keystring required

API Key for the service

Response

OK

descriptionstring

The description of the query

is_archivedboolean

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

is_privateboolean

Indicates if the query is private.

is_tempboolean

Indicates if the query is temporary (unsaved).

is_unsavedboolean

Indicates if the query is unsaved (legacy name).

namestring

The name of the query

ownerstring

username or team handle

query_enginestring

The query engine used to execute the query.

query_idinteger

The unique ID of the query

query_sqlstring

The SQL query text.

tagsstring[]

Tags associated with the query.

versioninteger

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

Example response

{
  "contributors": [
    {
      "contribution_count": 5,
      "handle": "wizardofdefi"
    }
  ],
  "description": "Calculate the average dex volume",
  "is_private": true,
  "name": "My Query",
  "owner": "dune",
  "query_engine": "medium",
  "query_id": 123,
  "query_sql": "SELECT * FROM dex.trades",
  "version": 1
}