---
title: "Returns the details of a query on Dune"
method: GET
path: "/v1/query/{queryId}"
---

# Returns the details of a query on Dune

`GET /v1/query/{queryId}`

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.

## Path parameters

- `queryId` integer, required

## Query parameters

- `api_key` string

## Headers

- `X-Dune-Api-Key` string, required

## Response `200`

OK

- ModelsGetQueryResponse
  - `contributors` ModelsQueryContributor[] — Contributors to the query (users who have created or saved it). Only included when include_contributors=true query parameter is set.
    - `contribution_count` integer — The number of contributions this user made to the query
    - `handle` string — The handle (username) of the contributor
  - `description` string — The description of the query
  - `is_archived` boolean — Indicates if the query is archived. Archived queries cannot be executed.
  - `is_private` boolean — Indicates if the query is private.
  - `is_temp` boolean — Indicates if the query is temporary (unsaved).
  - `is_unsaved` boolean — Indicates if the query is unsaved (legacy name).
  - `name` string — The name of the query
  - `owner` string — username or team handle
  - `parameters` ModelsParameter[] — The parameters that can modify the execution of the sql.
    - `description` string
    - `enumFromResults` ModelsEnumFromResults
      - `columnName` string
      - `queryId` integer
    - `enumOptions` string[]
    - `isFreeformAllowed` boolean
    - `isMultiselect` boolean
    - `key` string
    - `type` string
    - `value` string
    - `values` string[]
  - `query_engine` string — The query engine used to execute the query.
  - `query_id` integer — The unique ID of the query
  - `query_sql` string — The SQL query text.
  - `tags` string[] — Tags associated with the query.
  - `version` integer — Version of the query, gets incremented every time the query is updated.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/dune/apis/duneapi.md) · [All operations](https://skmtc.dev/dune/apis/duneapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dune/duneapi/revisions/f3a7a865f95b/schema)
