GET
/
v1
/
query
/
{query_id}
/
results
/
csv

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

"Rank,project,Total Volume,7 Days Volume,24 Hours Volume1,opensea,3.8364306116397446e+10,3.237919758883639e+07,3.3571613299256647e+06\n2,blur,8.183380589763865e+09,1.7107657915764195e+08,1.5850010061459592e+07\n3,x2y2,5.460294391448603e+09,4.0788931813965896e+06,223304.96681753657\n4,cryptopunks,2.675936453044167e+09,2.1720323415680006e+06,716042.4500000001\n5,looksrare,1.5984313877385368e+09,501530.0226954725,50185.290415\n6,superrare,3.044450076292612e+08,454080.3801810001,2711.41353\n7,foundation,2.22984396521278e+08,170730.43359724514,18791.057531650004\n8,sudoswap,1.1065119839239097e+08,91405.45237984283,49641.91309616044\n9,mooar,9.370740688511379e+07,3.816546773342194e+07,4.211704339041664e+06\n10,pancakeswap,8.577468809809853e+07,42632.499992789955,5097.792944599999\n11,tofu,6.714663559364942e+07,76521.97898920579,5380.136450808099\n12,element,6.122191042346895e+07,74343.29233116966,21615.498594265555\n13,zora,4.001828856803733e+07,<nil>,<nil>\n14,liquidifty,2.9701757197915018e+07,0.029847000000000005,0.029847000000000005\n15,quix,1.0831134834643008e+07,<nil>,<nil>\n16,magiceden,9.29307966848028e+06,4454.432874887,87.15784495\n17,rarible,5.376697231248505e+06,51386.83617665664,4985.105076420629\n18,archipelago,5.37401337817133e+06,<nil>,<nil>\n19,aavegotchi,3.0300035670567774e+06,20759.276957762435,3149.030878339999\n20,nftrade,1.7161576961230598e+06,26676.274663999986,106.961753999999\n21,dew,1.4541526609272424e+06,<nil>,<nil>\n22,nftb,1.336229907297191e+06,<nil>,<nil>\n23,decentraland,401287.6963697007,1036.6580888416527,60.78021429999997\n24,zonic,300264.3745252976,72.93842523849997,12.032011452799999\n25,nftearth,84818.42127523685,<nil>,<nil>\n26,aurem,464.10303347643816,9.788748,<nil>\n27,fractal,183.85717919121993,<nil>,<nil>\n28,oneplanet,131.71013616000002,<nil>,<nil>"

You must pass parameter query_id.

Returns the latest execution id and results (in CSV) 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).

  • Dune internally has a maximum query result size limit (which currently is 8GB, but subject to increase in the future). If your query yields more than 8GB of data, the result will be truncated in storage. In such cases, pulling the result data (using pagination) but without specifying allow_partial_results set to true will trigger an error message: “error”: “Partial Result, please request with ‘allows_partial_results=true’“. If you wish to retrieve partial results, you can pass the parameter allow_partial_results=true. But please make sure you indeed want to fetch the truncated result.

Headers

X-DUNE-API-KEY
string
required

API Key for the service

Path Parameters

query_id
integer
required

unique identifier of the query

Query Parameters

api_key
string

API Key for the service, alternative to using the HTTP header X-DUNE-API-KEY.

limit
integer
required

Limit number of rows to return. This together with 'offset' allows easy pagination through results in an incremental and efficient way. This parameter is incompatible with sampling (sample_count).

offset
integer

Offset row number to start (inclusive, first row means offset=0) returning results from. This together with 'limit' allows easy pagination through results in an incremental and efficient way. This parameter is incompatible with sampling (sample_count).

sample_count
integer

Number of rows to return from the result by sampling the data. This is useful when you want to get a uniform sample instead of the entire result. If the result has less than the sample count, the entire result is returned. Note that this will return a randomized sample, so not every call will return the same result. This parameter is incompatible with offset, limit, and filters parameters.

filters
string

Expression to filter out rows from the results to return. This expression is similar to a SQL WHERE clause. More details about it in the Filtering section of the doc. This parameter is incompatible with sample_count.

sort_by
string

Expression to define the order in which the results should be returned. This expression is similar to a SQL ORDER BY clause. More details about it in the Sorting section of the doc.

columns
string

Specifies a comma-separated list of column names to return. If omitted, all columns are included. Tip: use this to limit the result to specific columns, reducing datapoints cost of the call.

parameters
object[]

SQL Query parameters in key-value pairs. Each parameter is to be provided in key-value pairs. This enables you to execute a parameterized query with the provided values for your parameter keys. Partial submission of parameters is allowed. For example, if the query expects three parameters and you only pass in two, the third one will automatically use its default value as defined in the Query Parameter Editor page.

ignore_max_datapoints_per_request
boolean

There is a default 250,000 datapoints limit to make sure you don't accidentally spend all your credits in one call. To ignore the max limit, you can add ignore_max_datapoints_per_request=true

allow_partial_results
boolean

This enables returning a query result that was too large and only a partial result is available. By default allow_partial_results is set to false and a failed state is returned.

Response

200 - text/csv

The response is of type string.