List folders
curl --request GET \
--url https://api.dune.com/api/v1/folders \
--header 'X-Dune-Api-Key: <x-dune-api-key>'import requests
url = "https://api.dune.com/api/v1/folders"
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/folders', 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/folders",
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/folders"
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/folders")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/folders")
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{
"folders": [
{
"folder_id": "dp180Cu3jW3L",
"item_count": 12,
"name": "RWA",
"path": "/Research/RWA"
}
],
"next_offset": 123
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Invalid API Key"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Internal error"
}Folders
List Folders
List the folders directly inside a folder, or at the root of the library, ordered by name. A team API key works on the team’s folders as the team member who created the key; a personal key works on the user’s own folders. Page with limit and the next_offset returned by the previous response.
GET
/
v1
/
folders
List folders
curl --request GET \
--url https://api.dune.com/api/v1/folders \
--header 'X-Dune-Api-Key: <x-dune-api-key>'import requests
url = "https://api.dune.com/api/v1/folders"
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/folders', 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/folders",
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/folders"
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/folders")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/folders")
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{
"folders": [
{
"folder_id": "dp180Cu3jW3L",
"item_count": 12,
"name": "RWA",
"path": "/Research/RWA"
}
],
"next_offset": 123
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Invalid API Key"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Internal error"
}Minimum required API key scope:
ReadUse Cases
- Browse the Library: List top-level folders, or the subfolders of a folder with
parent_folder_id. - Find a Folder by Name: Use
name_containsto find the folder an agent should file content into. - Check Folder Size: Each folder returns an
item_countof the queries and dashboards inside it.
Headers
API Key for the service
Query Parameters
API Key, alternative to using the HTTP header X-Dune-Api-Key
List the subfolders of this folder. Omit for the library root.
Case-insensitive substring filter on the folder name
Maximum number of folders to return (default 50, max 100)
Number of results to skip. Use next_offset from the previous response
Was this page helpful?