---
title: "Download through the API | Grafana Cloud documentation"
description: "Download FOCUS datasets through the API"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/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](https://grafana.com/docs/grafana-cloud/cost-management-and-billing/set-up/focus-api-access/) 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.

![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```none
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:

![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```none
- `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`.

![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```none
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 `ChargePeriodStart` and `ChargePeriodEnd` are about one hour apart but don’t fall on the hour, for example `00:02:04` to `01: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 `periodRangeStart` or end after `periodRangeEnd`.
- `ChargePeriodEnd` is exclusive: a row ends where the next one starts.
