curl -X GET "https://api.dune.com/api/v1/execution/{{execution_id}}/status" -H x-dune-api-key:{{api_key}}
'''
Download Dune Python SDK by running `pip install dune-client`
For more info, visit the GitHub repository: https://github.com/duneanalytics/dune-client/tree/d2195b2a9577e2dcae5d2600cb3eddce20987f38
'''
import json
from dune_client.types import QueryParameter
from dune_client.client import DuneClient
from dune_client.query import QueryBase
# setup Dune Python client
dune = DuneClient()
result = dune.get_execution_status(job_id = '01HM79YYNXADPK66YWZK5X0NXB') # pass in the execution_id
import requests
url = "https://api.dune.com/api/v1/execution/{execution_id}/status"
headers = {"X-DUNE-API-KEY": "<x-dune-api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
fetch('https://api.dune.com/api/v1/execution/{execution_id}/status', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.dune.com/api/v1/execution/{execution_id}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-DUNE-API-KEY", "<x-dune-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dune.com/api/v1/execution/{execution_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-DUNE-API-KEY: <x-dune-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/execution/{execution_id}/status")
.header("X-DUNE-API-KEY", "<x-dune-api-key>")
.asString();
{
"execution_id": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
"query_id": 3493826,
"is_execution_finished": true,
"state": "QUERY_STATE_COMPLETED",
"submitted_at": "2025-10-22T10:31:04.222464Z",
"expires_at": "2026-01-20T10:31:04.36241Z",
"execution_started_at": "2025-10-22T10:31:05.123456Z",
"execution_ended_at": "2025-10-22T10:31:15.789012Z",
"execution_cost_credits": 10
}
{
"execution_id": "01K85QHSS0RBGW4BHDM0RFCG9C",
"query_id": 6012998,
"is_execution_finished": true,
"state": "QUERY_STATE_FAILED",
"submitted_at": "2025-10-22T10:31:04.222464Z",
"expires_at": "2026-01-20T10:31:04.36241Z",
"execution_cost_credits": 0,
"error": {
"type": "FAILED_TYPE_EXECUTION_FAILED",
"message": "line 1:8: Column 'x' cannot be resolved at line 1, position 8. Please verify that this column exists using the data explorer. Learn how to use the data explorer here: https://dune.com/docs/app/query-editor/data-explorer/ [Execution ID: 01K85QHSS0RBGW4BHDM0RFCG9C]",
"metadata": {
"line": 1,
"column": 8
}
}
}
Executions and Results
Get Execution Status
Returns the state of an execution, given the execution ID returned when the query or SQL was submitted for execution. Poll this until the execution completes, then read its results.
GET
/
v1
/
execution
/
{execution_id}
/
status
curl -X GET "https://api.dune.com/api/v1/execution/{{execution_id}}/status" -H x-dune-api-key:{{api_key}}
'''
Download Dune Python SDK by running `pip install dune-client`
For more info, visit the GitHub repository: https://github.com/duneanalytics/dune-client/tree/d2195b2a9577e2dcae5d2600cb3eddce20987f38
'''
import json
from dune_client.types import QueryParameter
from dune_client.client import DuneClient
from dune_client.query import QueryBase
# setup Dune Python client
dune = DuneClient()
result = dune.get_execution_status(job_id = '01HM79YYNXADPK66YWZK5X0NXB') # pass in the execution_id
import requests
url = "https://api.dune.com/api/v1/execution/{execution_id}/status"
headers = {"X-DUNE-API-KEY": "<x-dune-api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
fetch('https://api.dune.com/api/v1/execution/{execution_id}/status', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.dune.com/api/v1/execution/{execution_id}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-DUNE-API-KEY", "<x-dune-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dune.com/api/v1/execution/{execution_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-DUNE-API-KEY: <x-dune-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/execution/{execution_id}/status")
.header("X-DUNE-API-KEY", "<x-dune-api-key>")
.asString();
{
"execution_id": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
"query_id": 3493826,
"is_execution_finished": true,
"state": "QUERY_STATE_COMPLETED",
"submitted_at": "2025-10-22T10:31:04.222464Z",
"expires_at": "2026-01-20T10:31:04.36241Z",
"execution_started_at": "2025-10-22T10:31:05.123456Z",
"execution_ended_at": "2025-10-22T10:31:15.789012Z",
"execution_cost_credits": 10
}
{
"execution_id": "01K85QHSS0RBGW4BHDM0RFCG9C",
"query_id": 6012998,
"is_execution_finished": true,
"state": "QUERY_STATE_FAILED",
"submitted_at": "2025-10-22T10:31:04.222464Z",
"expires_at": "2026-01-20T10:31:04.36241Z",
"execution_cost_credits": 0,
"error": {
"type": "FAILED_TYPE_EXECUTION_FAILED",
"message": "line 1:8: Column 'x' cannot be resolved at line 1, position 8. Please verify that this column exists using the data explorer. Learn how to use the data explorer here: https://dune.com/docs/app/query-editor/data-explorer/ [Execution ID: 01K85QHSS0RBGW4BHDM0RFCG9C]",
"metadata": {
"line": 1,
"column": 8
}
}
}
Minimum required API key scope:
Readexecution_id obtained from making an execute query or execute SQL POST request.
Returns the status of a query execution along with relevant metadata of the results if the execution is completed. This endpoint now includes detailed error information when a query fails, eliminating the need to call the results endpoint just to get error details.
Pricing
This endpoint has no charge and does not consume credits. When present,execution_cost_credits is the source of truth for the credits consumed by that execution.
Execution States
Once an execution is triggered, it can be in one of the following states:QUERY_STATE_PENDING: The query execution is waiting for an execution slot.QUERY_STATE_EXECUTING: The query is currently executing.QUERY_STATE_FAILED: The query execution failed. This is a terminal state. The response will include detailed error information.QUERY_STATE_COMPLETED: The query execution completed successfully. You can retrieve the query result for this execution_id.QUERY_STATE_CANCELED: The query execution was canceled by the user.QUERY_STATE_EXPIRED: The query execution expired, and the result is no longer available.QUERY_STATE_COMPLETED_PARTIAL: The query execution was successful, but the result was truncated because it was too large. To receive the truncated result, set theallow_partial_resultsflag totruein the API request to fetch the result.
Error Response Fields
When a query execution fails (QUERY_STATE_FAILED), the response includes an error object with the following fields:
- type (string): Error type classification (e.g.,
FAILED_TYPE_EXECUTION_FAILED) - message (string): Detailed error message explaining what went wrong, including line and column information
- metadata (object): Additional error context
- line (integer): Line number where the error occurred
- column (integer): Column position where the error occurred
Some failed executions return
execution_cost_credits: 0, including SQL syntax/semantic errors, internal query-engine failures, and query-engine capacity-limit failures such as memory or stage limits.
curl -X GET "https://api.dune.com/api/v1/execution/{{execution_id}}/status" -H x-dune-api-key:{{api_key}}
'''
Download Dune Python SDK by running `pip install dune-client`
For more info, visit the GitHub repository: https://github.com/duneanalytics/dune-client/tree/d2195b2a9577e2dcae5d2600cb3eddce20987f38
'''
import json
from dune_client.types import QueryParameter
from dune_client.client import DuneClient
from dune_client.query import QueryBase
# setup Dune Python client
dune = DuneClient()
result = dune.get_execution_status(job_id = '01HM79YYNXADPK66YWZK5X0NXB') # pass in the execution_id
import requests
url = "https://api.dune.com/api/v1/execution/{execution_id}/status"
headers = {"X-DUNE-API-KEY": "<x-dune-api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
fetch('https://api.dune.com/api/v1/execution/{execution_id}/status', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.dune.com/api/v1/execution/{execution_id}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-DUNE-API-KEY", "<x-dune-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dune.com/api/v1/execution/{execution_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-DUNE-API-KEY: <x-dune-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/execution/{execution_id}/status")
.header("X-DUNE-API-KEY", "<x-dune-api-key>")
.asString();
{
"execution_id": "01HKZJ2683PHF9Q9PHHQ8FW4Q1",
"query_id": 3493826,
"is_execution_finished": true,
"state": "QUERY_STATE_COMPLETED",
"submitted_at": "2025-10-22T10:31:04.222464Z",
"expires_at": "2026-01-20T10:31:04.36241Z",
"execution_started_at": "2025-10-22T10:31:05.123456Z",
"execution_ended_at": "2025-10-22T10:31:15.789012Z",
"execution_cost_credits": 10
}
{
"execution_id": "01K85QHSS0RBGW4BHDM0RFCG9C",
"query_id": 6012998,
"is_execution_finished": true,
"state": "QUERY_STATE_FAILED",
"submitted_at": "2025-10-22T10:31:04.222464Z",
"expires_at": "2026-01-20T10:31:04.36241Z",
"execution_cost_credits": 0,
"error": {
"type": "FAILED_TYPE_EXECUTION_FAILED",
"message": "line 1:8: Column 'x' cannot be resolved at line 1, position 8. Please verify that this column exists using the data explorer. Learn how to use the data explorer here: https://dune.com/docs/app/query-editor/data-explorer/ [Execution ID: 01K85QHSS0RBGW4BHDM0RFCG9C]",
"metadata": {
"line": 1,
"column": 8
}
}
}
Response
OK
Was this page helpful?