- The data in the files must conform to the schema, and must use the same column names as the schema.
- One successful
/insertrequest consumes 10 credits.
curl --request POST \
--url https://api.dune.com/api/v1/table/my_user/interest_rates/insert \
--header 'X-DUNE-API-KEY: <x-dune-api-key>' \
--header 'Content-Type: text/csv' \
--upload-file interest_rates.csv
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()
with open("./interest_rates.csv", "rb") as data:
response = dune.insert_table(
namespace="my_user",
table_name="interest_rates",
data=data,
content_type="text/csv"
)
import requests
url = "https://api.dune.com/api/v1/table/my_user/interest_rates/insert"
headers = {
"X-DUNE-API-KEY": "<x-dune-api-key>",
"Content-Type": "text/csv"
}
with open("./interest_rates.csv", "rb") as data:
response = requests.request("POST", url, data=data, headers=headers)
const url = "https://api.dune.com/api/v1/table/my_user/interest_rates/insert";
const headers = {
"X-DUNE-API-KEY": "<x-dune-api-key>",
"Content-Type": "text/csv"
};
fs.readFile('./interest_rates.csv', (err, data) => {
if (err) {
console.error(err);
return;
}
fetch(url, {
method: 'POST',
headers: headers,
body: data
})
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
});
Tables (upload data)
Insert Data (beta)
Insert the data in a file into a table.
To be able to insert into a table, it must have been created with the /create endpoint.
CSV files (
CSV files must use a comma as delimiter, and the column names in the header must match the column names of the table.JSON files (
These are files where each line is a complete JSON object which creates one table row. Each line must have keys that match the column names of the table.Was this page helpful?

