For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/usage-metering/get-hourly-usage-for-ci-visibility.md. A documentation index is available at /llms.txt.
Language
Datadog site

Get hourly usage for CI visibility

GEThttps://api.datadoghq.com/api/v1/usage/ci-apphttps://api.us3.datadoghq.com/api/v1/usage/ci-apphttps://api.us5.datadoghq.com/api/v1/usage/ci-apphttps://api.datadoghq.eu/api/v1/usage/ci-apphttps://api.ap1.datadoghq.com/api/v1/usage/ci-apphttps://api.ap2.datadoghq.com/api/v1/usage/ci-apphttps://api.uk1.datadoghq.com/api/v1/usage/ci-apphttps://api.ddog-gov.com/api/v1/usage/ci-apphttps://api.us2.ddog-gov.com/api/v1/usage/ci-app

Overview

Get hourly usage for CI visibility (tests, pipeline, and spans). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

This endpoint requires the usage_read permission.

OAuth apps require the usage_read authorization scope to access this endpoint.

Arguments

Query Strings

Name
Type
Description
start_hr [required]
string

Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

end_hr
string

Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Response

OK

CI visibility usage response

Field
Type
Description
usage
[object]

Response containing CI visibility usage.

Code Example

Get hourly usage for CI visibility
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_hr="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v1/usage/ci-app?start_hr=${start_hr}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"