Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/platform/cost-management-and-billing/focus/focus-api-usage.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/platform/cost-management-and-billing/focus/focus-api-usage/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Download FOCUS datasets through the API
You can download FOCUS datasets through the API endpoint. The API endpoint exposes two options for focus data: monthly and hourly.
Before you begin
You must create a Cloud Access Policy with the org-billing-focus:read permission and generate a token.
Query the FOCUS API
Replace <YOUR_TOKEN> with the token you created in the previous step, and <YOUR_ORG_NAME> with your org name.
Replace the optional <GRANULARITY> parameter with one of the options: monthly or hourly. When not specified, monthly is the default.
curl -H "Authorization: Bearer <YOUR_TOKEN>" \
"https://grafana.com/api/orgs/<YOUR_ORG_NAME>/focus?granularity=<GRANULARITY>"The response is a CSV file with the following headers:
- `content-type: text/csv`
- `content-disposition: attachment; filename=<YOUR_ORG_ID>_focus.csv`Query hourly data
Use periodRangeStart and periodRangeEnd to limit hourly data to a date range.
Use full ISO 8601 dates in UTC, for example 2026-10-04T00:00:00Z.
curl -H "Authorization: Bearer <YOUR_TOKEN>" \
"https://grafana.com/api/orgs/<YOUR_ORG_NAME>/focus?granularity=hourly&periodRangeStart=2026-10-04T00:00:00Z&periodRangeEnd=2026-10-05T00:00:00Z"Request at most one month (30 days) of hourly data per call. For a longer period, split it into several requests.
How hourly rows line up with the range
- Each hourly row covers the time between two runs of the billing pipeline. The runs start a few minutes after each hour, so
ChargePeriodStartandChargePeriodEndare about one hour apart but don’t fall on the hour, for example00:02:04to01:01:46. - The API returns every row that overlaps the requested range, and both range bounds are inclusive. The first and last rows can therefore start before
periodRangeStartor end afterperiodRangeEnd. ChargePeriodEndis exclusive: a row ends where the next one starts.
Was this page helpful?
Related resources from Grafana Labs


