---
title: "Get library analytics"
method: GET
path: "/v2/teamspaces/{teamspaceId}/libraries/{owner}/{repo}/analytics"
tags: ["Teamspace Libraries"]
---

# Get library analytics

`GET /v2/teamspaces/{teamspaceId}/libraries/{owner}/{repo}/analytics`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v2/teamspaces/{teamspaceId}/libraries/{owner}/{repo}/analytics`
- Auth: HTTP bearer

Usage of a library the teamspace has claimed.

## Response `200`

The report

- union
  - TeamspaceLibraryUsageReport: `report=usage`: request counts.
    - `current` ProjectStats, required: Cumulative request counts for a library, broken down by request surface
      - `page` integer, required: Requests served to the context7.com web UI
      - `txt` integer, required: Plain-text documentation requests
      - `mcp` integer, required: Requests served via the Context7 MCP server
      - `cli` integer, required: Requests served to the Context7 CLI
    - `daily` DailyStatsPoint[], required: Per-day counts, oldest first, for up to `days` days.
      - `date` string, date, required: UTC date in `YYYY-MM-DD` format
      - `page` integer, required: Requests served to the context7.com web UI on this date
      - `txt` integer, required: Plain-text documentation requests on this date
      - `mcp` integer, required: Requests served via the Context7 MCP server on this date
      - `cli` integer, required: Requests served to the Context7 CLI on this date
      - `total` integer, required: Sum of all request surfaces on this date (`page + txt + mcp + cli`)
  - TeamspaceLibraryTopicsReport: `report=topics`: lifetime topics of the requests.
    - `libraryId` string, required
    - `topics` TopicCount[], required
      - `topic` string, required: Normalized, lowercased topic string
      - `count` integer, required: Number of requests that referenced this topic
    - `totalRequests` integer, required
  - TeamspaceLibraryCountriesReport: `report=countries`: lifetime countries of the requests.
    - `libraryId` string, required
    - `countries` CountryCount[], required
      - `country` string, required: ISO 3166-1 alpha-2 country code
      - `count` integer, required: Number of requests originating from this country
    - `totalRequests` integer, required
  - McpClientMetrics: MCP client usage breakdown by day
    - `dailyData` McpDailyClientData[], required: Per-day MCP client unique-user breakdown, ordered from oldest to newest
      - `date` string, date, required: UTC date in `YYYY-MM-DD` format
      - `uniqueUsersByClient` object, required: Unique user count per MCP client identifier (e.g., `cursor`, `claude-code`, `codex`)
      - `totalUniqueUsers` integer, required: Total unique users across all clients for this library on this date

## Other responses

- `400`: Unknown report or invalid days
- `401`: Unauthorized - Invalid or missing API key
- `403`: The caller cannot access the teamspace or its role is too low (`forbidden`), or the teamspace has not claimed the library (`not_owner`)
- `404`: The teamspace has no library with this id (neither claimed nor one of its private sources)
- `500`: Internal Server Error

## Changes

- **2026-10-22** `e17589fd8767`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v2/teamspaces/:teamspaceId/libraries/:owner/:repo/analytics/get.md)

---

[API](https://skmtc.dev/context7/apis/context7-public-api.md) - [All operations](https://skmtc.dev/context7/apis/context7-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/context7/apis/context7-public-api/revisions/945f7834fa8c?raw)
