---
title: "Usage Stats"
method: GET
path: "/keys/{key}/usage"
tags: ["Keys"]
---

# Usage Stats

`GET /keys/{key}/usage`

Reports the number of lookups consumed on a key for a range of days.

A maximum interval of 90 days can be provided for analysis. If no start or end date is provided, the last 21 days will be used as the default interval.

If no `start` time is provided, the start time will be set to 21 days prior to the current time.

If no `end` time is provided, the current time will be used.

Append `tags` to scope the number of lookups to those with matching tag values. E.g. `tags=foo,bar` will only count transactions that match `foo` and `bar`.

## Path parameters

- `key` string, required

## Query parameters

- `user_token` string
- `start` integer
- `end` integer
- `tags` string
- `licensee` string

## Response `200`

Success

- ApiKeyUsageResponse
  - `result` KeyUsageResult, required
    - `start` string, required — Start date in ISO 8601 format.
    - `end` string, required — End date in ISO 8601 format.
    - `total` integer, required — Total of paid lookups performed in specified period.
    - `dailyCount` object[], required — An array of objects representing number of paid lookups made on specific days, ordered by date. Each object contains a `date` attribute, which represents the day and a `count` attribute, which represents the number of paid lookups made on that day.
      - `date` string, required
      - `count` integer, required
  - `code` 2000, required
  - `message` 'Success', required

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/ideal-postcodes/apis/api-reference.md) · [All operations](https://skmtc.net/ideal-postcodes/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ideal-postcodes/api-reference/versions/295dd3238f22/schema)
