provider Usage Metering GET /api/v2/usage/historical_cost
@utdk/datadog /api/v2/usage/historical_cost
Get historical cost across your account
Get historical cost across multi-org and single root-org accounts. Cost data for a given month becomes available no later than the 16th of the following month. This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
start_month query required
Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month.
string
view query
String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`.
string
end_month query
Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
string
include_connected_accounts query
Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
boolean

Try it

Authentication
Configure credentials for Datadog API V2 Collection
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

gethistoricalcostbyorg
GET/api/v2/usage/historical_cost
Get historical cost across multi-org and single root-org accounts. Cost data for a given month becomes available no later than the 16th of the following month. This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).

required

Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month.

String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`.

Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.

Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import datadog from '@utdk/datadog';

await datadog.gethistoricalcostbyorg({
  "include_connected_accounts": false
})