Skip to main content
You must pass parameter query_id. Returns the latest execution id and results (in JSON) of that latest run, regardless of the job id/run or if it is run in the app or the api. The query specified must either be public or a query you have ownership of (you or a team you belong to have ownership).
This endpoint does NOT trigger an execution but does consume credits through datapoints.
  • There is currently a 1GB limit in how much data a single API result call can return, but there is a chance we reduce this overall or based on varying paid plan types.
  • To paginate query results, please visit the pagination page to get more info.
If you are using the Python SDK, you can directly executes and fetches result in one function call, like below:
Python SDK

import dotenv, os, json
from dune_client.types import QueryParameter
from dune_client.client import DuneClient
from dune_client.query import QueryBase

# change the current working directory where .env file lives
os.chdir("/Users/abc/local-Workspace/python-notebook-examples")
# load .env file
dotenv.load_dotenv(".env")
# setup Dune Python client
dune = DuneClient.from_env()

Use run_query to get result in JSON, run_query_csv to get result in CSV format, and run_query_dataframe to get result in Pandas dataframe

result = dune.run_query(
    query=query # pass in query to run 
    , performance = 'large' # optionally define which tier to run the execution on (default is "medium")
    )


curl --request GET \
  --url https://api.dune.com/api/v1/query/{query_id}/results