List schedules
curl --request GET \
--url https://api.dune.com/api/v1/schedules \
--header 'X-Dune-Api-Key: <x-dune-api-key>'import requests
url = "https://api.dune.com/api/v1/schedules"
headers = {"X-Dune-Api-Key": "<x-dune-api-key>"}
response = requests.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/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dune.com/api/v1/schedules",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dune.com/api/v1/schedules"
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, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/schedules")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
response = http.request(request)
puts response.read_body{
"schedules": [
{
"cron_expression": "0 6 * * *",
"dashboard_id": 123,
"expires_at": "<string>",
"next_execution_time": "<string>",
"performance": "medium",
"query_id": 1234567,
"type": "query"
}
],
"total": 123
}{
"error": "Bad Request"
}{
"error": "Invalid API Key"
}{
"error": "Not allowed to execute query. Query is archived, unsaved or not enough permissions"
}{
"error": "Internal error"
}Schedules
List Schedules
List the schedules owned by the API key’s account: scheduled query runs, scheduled dashboard refreshes, and materialized view refreshes. A schedule belongs to the owner of its query or dashboard.
GET
/
v1
/
schedules
List schedules
curl --request GET \
--url https://api.dune.com/api/v1/schedules \
--header 'X-Dune-Api-Key: <x-dune-api-key>'import requests
url = "https://api.dune.com/api/v1/schedules"
headers = {"X-Dune-Api-Key": "<x-dune-api-key>"}
response = requests.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/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dune.com/api/v1/schedules",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dune.com/api/v1/schedules"
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, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/schedules")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
response = http.request(request)
puts response.read_body{
"schedules": [
{
"cron_expression": "0 6 * * *",
"dashboard_id": 123,
"expires_at": "<string>",
"next_execution_time": "<string>",
"performance": "medium",
"query_id": 1234567,
"type": "query"
}
],
"total": 123
}{
"error": "Bad Request"
}{
"error": "Invalid API Key"
}{
"error": "Not allowed to execute query. Query is archived, unsaved or not enough permissions"
}{
"error": "Internal error"
}Minimum required API key scope:
ReadUse Cases
- Audit Credit Use: See every schedule, with its frequency and performance tier, in one call.
- Read Before You Change: Get the current settings of a schedule before a
PUT, because aPUTreplaces all of them. - Find Expiring Schedules: Each schedule returns its
expires_atandnext_execution_time.
Headers
API Key for the service
Query Parameters
Maximum number of schedules to return (default 20, max 100)
Number of schedules to skip
Was this page helpful?