Show examples in:
JavascriptHTTP
Endpoint info
Available examples
Dashboard API > Daily Usage

Retrieve daily usage info for either an account or an organization

Warning: Experimental API

Please note that the Dashboard API is an experimental, prerelease API. This API method is considered unstable, and should be avoided in production environments and automations. Changes may occur at any time without warning.

Query parameters

yearstring

Year of the daily usages to retrieve. Defaults to current year.

Example:"2024"
monthstring

Monthof the daily usages to retrieve. Defaults to current month.

Example:"2"

Returns

Returns an array of resource objects of type daily_usage.

Examples

GET https://site-api.datocms.com/daily-site-usages HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/daily-site-usages' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/daily-site-usages", {
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"type": "daily_usage",
"id": "412",
"attributes": {
"date": "",
"cda_api_calls": 20,
"cma_api_calls": 20,
"cda_traffic_bytes": 20,
"cma_traffic_bytes": 20,
"assets_traffic_bytes": 20,
"mux_delivered_seconds": 20,
"mux_high_resolution_delivered_seconds": 20,
"mux_encoded_seconds": 20,
"smart_tags_detections": 20
},
"relationships": {
"site": {
"data": {
"type": "site",
"id": "155"
}
}
}
}
],
"included": [
{
"type": "site",
"id": "155",
"attributes": {
"name": "My blog",
"domain": "admin.foobar.com",
"internal_domain": "clueless-star-1231.admin.datocms.com",
"last_data_change_at": "2020-04-21T07:57:11.124Z",
"access_token": "",
"created_at": "2020-04-21T07:57:11.124Z",
"deactivated": true
},
"meta": {
"last_data_change_at": "2017-03-30T09:29:14.872Z",
"created_at": "2017-03-30T09:29:14.872Z",
"deactivated": true,
"status": "",
"owner": {
"type": "account",
"email": "mark@foobar.com"
},
"require_2fa": false
},
"relationships": {
"active_subscription": {
"data": null
},
"active_plan": {
"data": null
},
"transfer": {
"data": {
"type": "site_transfer",
"id": "124"
}
}
}
}
]
}