# npm Trends API [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/trendsapi-ai/npm-trends-api  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/npm-trends-api-2

## Description
npm package download trends and adoption growth over time. Free key at trendsapi.ai

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "npm-trends-api": {
    "command": "uvx",
    "args": ["trendsapi-npm"],
    "env": {
      "TRENDSAPI_KEY": ""
    }
  }
}
```

**Requires environment variables:** `TRENDSAPI_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What npm Trends API does

The npm Trends API MCP server connects package-trend queries to Trends API. It works with exact npm package names, including scoped names such as `@tanstack/react-query`, and returns historical interest data or calculated growth over time. The history uses a normalized 0–100 index for each series. Absolute volume may also be present when the upstream data provides it.

The npm Trends API MCP server is suited to questions such as whether a package’s adoption signal is rising, how its recent trend compares with a prior period, or which trend results are available from the service. It should not be treated as a source of exact integer npm download totals.

## How it works

Requests are sent to `https://api.trendsapi.ai/api` as JSON `POST` calls. Authentication uses a bearer token in the `Authorization` header. For npm history queries, the request identifies the `npm` source and uses a mode such as `get_time_series` or `get_growth`.

A time-series response contains dated points with `date`, `value`, and `keyword` fields. Dates use `YYYY-MM-DD`, while values are normalized to the series’ 0–100 scale. Growth responses contain the searched term, source information, one result per requested period, and metadata. Multiple growth windows count as one request, according to the provided client documentation.

## Setup and configuration

Create a key at trendsapi.ai and provide it through the `TRENDSAPI_KEY` environment variable. The documented SDK installation is:

```bash
pip install trendsapi-npm
export TRENDSAPI_KEY=your_key
```

The client supports Python 3.9 and later. A key can also be passed directly to the Python client, although environment-based configuration is the documented default. The raw HTTP request requires `Content-Type: application/json` and the bearer authorization header.

No MCP-specific installation command, transport configuration, or client setup is described in the supplied material. The repository documentation instead describes the underlying Python client and HTTP contract.

## Tools and capabilities

The npm Trends API MCP server’s documented operations correspond to these API methods:

- `get_time_series` retrieves historical points for an exact package keyword.
- `get_growth` calculates growth for periods such as `7D`, `3M`, `12M`, `YTD`, or custom date ranges.
- `get_top_trends` requests the service’s top-trend response using its supported type and other parameters.

The Python package also documents synchronous and asynchronous clients. Returned Python values use typed objects and attributes such as `.date`, `.value`, and `.results[0].growth`; JavaScript responses use object properties. Time-series data can be converted into a pandas DataFrame for further analysis.

## Limitations and notes

Use one package per request, and preserve exact package spelling. The source value is lowercase `npm`; source and type values are validated separately, and incorrect spelling can produce a 400 response. Do not URL-encode `@` or `/` inside the JSON request body.

A 401 response indicates a missing or invalid key, 404 means no series exists for the keyword, and 429 indicates quota exhaustion. Server errors are retried by the client before it raises an error. Raw HTTP responses include a JSON string in the `body` field, so curl callers must decode that field separately. Each successful asynchronous call is billed as one request.

The npm Trends API MCP server reports trend indexes and available volume fields, not guaranteed exact download counts. For exact integer counts, the documentation points to `api.npmjs.org/downloads`.

_Full upstream README: https://allmcps.com/mcp/npm-trends-api-2/readme_

