Skip to main content
POST
/
v1
/
datasets
/
search
Search datasets
curl --request POST \
  --url https://api.dune.com/api/v1/datasets/search \
  --header 'Content-Type: application/json' \
  --header 'X-Dune-Api-Key: <x-dune-api-key>' \
  --data '
{
  "blockchains": [
    "<string>"
  ],
  "categories": [
    "<string>"
  ],
  "dataset_types": [
    "<string>"
  ],
  "include_metadata": true,
  "include_private": true,
  "include_schema": true,
  "limit": 123,
  "offset": 123,
  "owner_scope": "<string>",
  "query": "<string>",
  "schemas": [
    "<string>"
  ]
}
'
import requests

url = "https://api.dune.com/api/v1/datasets/search"

payload = {
"blockchains": ["<string>"],
"categories": ["<string>"],
"dataset_types": ["<string>"],
"include_metadata": True,
"include_private": True,
"include_schema": True,
"limit": 123,
"offset": 123,
"owner_scope": "<string>",
"query": "<string>",
"schemas": ["<string>"]
}
headers = {
"X-Dune-Api-Key": "<x-dune-api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-Dune-Api-Key': '<x-dune-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
blockchains: ['<string>'],
categories: ['<string>'],
dataset_types: ['<string>'],
include_metadata: true,
include_private: true,
include_schema: true,
limit: 123,
offset: 123,
owner_scope: '<string>',
query: '<string>',
schemas: ['<string>']
})
};

fetch('https://api.dune.com/api/v1/datasets/search', 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/datasets/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'blockchains' => [
'<string>'
],
'categories' => [
'<string>'
],
'dataset_types' => [
'<string>'
],
'include_metadata' => true,
'include_private' => true,
'include_schema' => true,
'limit' => 123,
'offset' => 123,
'owner_scope' => '<string>',
'query' => '<string>',
'schemas' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.dune.com/api/v1/datasets/search"

payload := strings.NewReader("{\n \"blockchains\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"dataset_types\": [\n \"<string>\"\n ],\n \"include_metadata\": true,\n \"include_private\": true,\n \"include_schema\": true,\n \"limit\": 123,\n \"offset\": 123,\n \"owner_scope\": \"<string>\",\n \"query\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Dune-Api-Key", "<x-dune-api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.dune.com/api/v1/datasets/search")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blockchains\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"dataset_types\": [\n \"<string>\"\n ],\n \"include_metadata\": true,\n \"include_private\": true,\n \"include_schema\": true,\n \"limit\": 123,\n \"offset\": 123,\n \"owner_scope\": \"<string>\",\n \"query\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dune.com/api/v1/datasets/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"blockchains\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"dataset_types\": [\n \"<string>\"\n ],\n \"include_metadata\": true,\n \"include_private\": true,\n \"include_schema\": true,\n \"limit\": 123,\n \"offset\": 123,\n \"owner_scope\": \"<string>\",\n \"query\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "pagination": {
    "has_more": true,
    "limit": 123,
    "next_offset": 123,
    "offset": 123
  },
  "results": [
    {
      "blockchains": [
        "<string>"
      ],
      "category": "<string>",
      "dataset_type": "<string>",
      "description": "<string>",
      "full_name": "<string>",
      "metadata": {
        "abi_type": "<string>",
        "contract_name": "<string>",
        "description": "<string>",
        "page_rank_score": 123,
        "project_name": "<string>",
        "spell_metadata": [
          123
        ],
        "spell_type": "<string>"
      },
      "owner_scope": "<string>",
      "schema": [
        123
      ],
      "visibility": "<string>"
    }
  ],
  "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: Read

Use Cases

  • Free-Text Search: Search across Dune’s entire dataset catalog using natural language queries like "dex trades" or "ethereum transactions".
  • Filter by Category: Narrow results to specific categories such as canonical, decoded, spell, or community datasets.
  • Filter by Blockchain: Find datasets for specific blockchains by passing blockchain names in the blockchains parameter.
  • AI Agents: Enable AI agents to discover relevant tables and schemas before constructing SQL queries.
  • Build Search UIs: Power custom dataset search interfaces and data discovery tools on top of Dune’s catalog.

Headers

X-Dune-Api-Key
string
required

API Key for the service

Query Parameters

api_key
string

API Key, alternative to using the HTTP header X-Dune-Api-Key

Body

application/json

Search datasets request

blockchains
string[]
categories
string[]
dataset_types
string[]
include_metadata
boolean
include_private
boolean
include_schema
boolean
limit
integer
offset
integer
owner_scope
string
query
string
schemas
string[]

Response

OK

pagination
object
results
object[]
total
integer