---
title: "Get hourly usage for logs by index"
method: GET
path: "/api/v1/usage/logs_by_index"
tags: ["Usage Metering"]
---

# Get hourly usage for logs by index

`GET /api/v1/usage/logs_by_index`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/usage/logs_by_index`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `usage_read`

Get hourly usage for logs by index.

## Query parameters

- `start_hr` string, date-time, required
- `end_hr` string, date-time
- `index_name` string[]

## Response `200`

OK

- UsageLogsByIndexResponse: Response containing the number of indexed logs for each hour and index for a given organization.
  - `usage` UsageLogsByIndexHour[]: An array of objects regarding hourly usage of logs by index response.
    - `event_count` integer: The total number of indexed logs for the queried hour.
    - `hour` string, date-time: The hour for the usage.
    - `index_id` string: The index ID for this usage.
    - `index_name` string: The user specified name for this index ID.
    - `org_name` string: The organization name.
    - `public_id` string: The organization public ID.
    - `retention` integer: The retention period (in days) for this index ID.

## Other responses

- `400`: Bad Request
- `403`: Forbidden - User is not authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
