- If a table already exists with the same name, the request will fail.
- Column names in the table can’t start with a special character or a digit.
- Each successful table creation consumes 100 credits.
- To delete a table, you can go to
user settings (dune.com) -> data -> deleteor use the /delete endpoint.
curl --request POST \
--url https://api.dune.com/api/v1/table/create \
--header 'X-DUNE-API-KEY: <x-dune-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"namespace":"my_user",
"table_name":"interest_rates",
"description": "10 year daily interest rates, sourced from https://fred.stlouisfed.org/series/DGS10",
"is_private": false,
"schema": [{"name": "date", "type": "timestamp"}, {"name": "dgs10", "type": "double"}]
}'
import dotenv, os
from dune_client.client import DuneClient
dotenv_path = os.path.join(os.path.dirname(__file__), '.', '.env')
dotenv.load_dotenv(".env")
dune = DuneClient.from_env()
table = dune.create_table(
namespace="my_user",
table_name="interest_rates",
description="10 year daily interest rates, sourced from https://fred.stlouisfed.org/series/DGS10",
schema= [
{"name": "date", "type": "timestamp"},
{"name": "dgs10", "type": "double"}
],
is_private=False
)
import requests
url = "https://api.dune.com/api/v1/table/create"
payload = {
"namespace": "my_user",
"table_name": "interest_rates",
"description": "10 year daily interest rates, sourced from https://fred.stlouisfed.org/series/DGS10",
"schema": [{"name": "date", "type": "timestamp"}, {"name": "dgs10", "type": "double"}],
"is_private": False
}
headers = {
"X-DUNE-API-KEY": "<x-dune-api-key>",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
const url = "https://api.dune.com/api/v1/table/create";
const payload = {
"namespace": "my_user",
"table_name": "interest_rates",
"description": "10 year daily interest rates, sourced from https://fred.stlouisfed.org/series/DGS10",
"schema": [{"name": "date", "type": "timestamp"}, {"name": "dgs10", "type": "double"}],
"is_private": false
};
const headers = {
"X-DUNE-API-KEY": "<x-dune-api-key>",
"Content-Type": "application/json"
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Tables (upload data)
Create Table (beta)
Create a new Dune table with the specified name and namespace.
The resulting table will be empty, and can be inserted into with the /insert endpoint.
Was this page helpful?

