v1

latestOpenAPI 3.0.02026-07-13162290.3 KB
Metrics

Get library usage metrics

Retrieve full usage metrics for a library: cumulative and daily request counters broken down by surface (web page, text docs, MCP, CLI), MCP client daily unique-user breakdown, and lifetime topic and country distributions. The API key must belong to a member of the teamspace that owns the library — claim ownership from the library's admin page on context7.com.

get/v2/libs/metrics

Query parameters

libraryIdstring required

Context7-compatible library ID — the URL path of the library on context7.com. Use /owner/repo for GitHub repositories, or /<source>/<id> for other sources (websites, llms.txt, GitLab/Bitbucket, etc.). Optionally suffix with /<version> or @<version> to pin a specific version. See Library ID format.

daysinteger

Number of days of daily history to return (1-365). Defaults to 30.

Response

Library usage metrics

Example response

{
  "daily": [
    {
      "date": "2025-01-15"
    }
  ],
  "mcpClients": {
    "dailyData": [
      {
        "date": "2025-01-15"
      }
    ]
  },
  "topics": [
    {
      "topic": "routing"
    }
  ],
  "countries": [
    {
      "country": "US"
    }
  ]
}