---
title: "Get all v4 APIs with hits count per API sorted by mostly requested"
method: GET
path: "/analytics/top-hits"
tags: ["Environment Analytics"]
---

# Get all v4 APIs with hits count per API sorted by mostly requested

`GET /analytics/top-hits`

## Request

- Base URL: `/management/v2/environments/DEFAULT` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/management/v2/environments/DEFAULT/analytics/top-hits`
- Auth: one of:
  - HTTP basic
  - API key in cookie `Auth-Graviteeio-APIM`

Get v4 API analytics top hits counts. All APIs are sorted starting from the most requested ones.

## Query parameters

- `from` integer
- `to` integer

## Response `200`

Analytics for v2 and v4 top hits APIs at environment level

- object: Analytics for top hits APIs at environment level
  - `data` TopHitApi[]: List of top hit results
    - `id` string: The API ID
    - `name` string: The API Name
    - `count` integer: The API Hit count
    - `definitionVersion` string: The API definition version

## Other responses

- `default`: Generic error response

---

[API](https://skmtc.dev/gravitee-io/apis/gravitee-io-apim-management-api-environments.md) - [All operations](https://skmtc.dev/gravitee-io/apis/gravitee-io-apim-management-api-environments/llms.txt) - [OpenAPI document](https://skmtc.dev/gravitee-io/apis/gravitee-io-apim-management-api-environments/revisions/b736a7e375df?raw)
