curl -X POST "https://api.dune.com/api/v1/usage" \
-H "Content-Type: application/json" \
-H "X-DUNE-API-KEY: YOUR_API_KEY" \
-d '{
"start_date": "2025-01-01",
"end_date": "2025-02-01"
}'
import requests
url = "https://api.dune.com/api/v1/usage"
headers = {
"X-DUNE-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"start_date": "2025-01-01",
"end_date": "2025-02-01"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://api.dune.com/api/v1/usage';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-DUNE-API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
start_date: '2025-01-01',
end_date: '2025-02-01'
})
});
const data = await response.json();
console.log(data);
{
"private_queries": 100,
"private_dashboards": 100,
"bytes_used": 1000,
"bytes_allowed": 10101,
"billingPeriods": [
{
"start_date": "2025-01-01",
"end_date": "2025-02-01",
"credits_used": 100.10,
"credits_included": 100000
}
]
}
Account Management
Get Usage
Retrieve customer usage data for billing periods
POST
/
v1
/
usage
curl -X POST "https://api.dune.com/api/v1/usage" \
-H "Content-Type: application/json" \
-H "X-DUNE-API-KEY: YOUR_API_KEY" \
-d '{
"start_date": "2025-01-01",
"end_date": "2025-02-01"
}'
import requests
url = "https://api.dune.com/api/v1/usage"
headers = {
"X-DUNE-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"start_date": "2025-01-01",
"end_date": "2025-02-01"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://api.dune.com/api/v1/usage';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-DUNE-API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
start_date: '2025-01-01',
end_date: '2025-02-01'
})
});
const data = await response.json();
console.log(data);
{
"private_queries": 100,
"private_dashboards": 100,
"bytes_used": 1000,
"bytes_allowed": 10101,
"billingPeriods": [
{
"start_date": "2025-01-01",
"end_date": "2025-02-01",
"credits_used": 100.10,
"credits_included": 100000
}
]
}
Minimum required API key scope:
ReadDescription
Retrieves customer usage data including credits, queries, dashboards, and storage. Returns the current billing period when no timeframe is specified.Pricing
This is a metadata endpoint and does not consume credits.curl -X POST "https://api.dune.com/api/v1/usage" \
-H "Content-Type: application/json" \
-H "X-DUNE-API-KEY: YOUR_API_KEY" \
-d '{
"start_date": "2025-01-01",
"end_date": "2025-02-01"
}'
import requests
url = "https://api.dune.com/api/v1/usage"
headers = {
"X-DUNE-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"start_date": "2025-01-01",
"end_date": "2025-02-01"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://api.dune.com/api/v1/usage';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-DUNE-API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
start_date: '2025-01-01',
end_date: '2025-02-01'
})
});
const data = await response.json();
console.log(data);
{
"private_queries": 100,
"private_dashboards": 100,
"bytes_used": 1000,
"bytes_allowed": 10101,
"billingPeriods": [
{
"start_date": "2025-01-01",
"end_date": "2025-02-01",
"credits_used": 100.10,
"credits_included": 100000
}
]
}
Headers
API Key for the service
Query Parameters
API Key, alternative to using the HTTP header X-Dune-Api-Key
Body
application/json
Request payload with optional start_date and end_date
Was this page helpful?