# npm Trends API

npm Trends API supplies AI coding assistants with 0-100 normalized download history and growth rates for npm packages. Helps evaluate package momentum directly in your IDE.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: trendsapi-ai
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/trendsapi-ai/npm-trends-api
- Updated: 2026-08-18
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/npm-trends-api

## What it does

This server connects coding agents to package adoption metrics using the endpoint `https://npm.api.trendsapi.ai/mcp`. It exposes tools to fetch time series points and calculate growth across intervals such as 7D, 30D, 12M, or custom date baselines.

Requests require a free key set in `TRENDSAPI_KEY`, obtained from `trendsapi.ai`. Package names must match exactly and remain case-sensitive, including scoped names like `@tanstack/react-query`. Each call inspects a single library at a time.

Values represent a normalized 0-100 index rather than raw integers. When your task requires exact download counts, query `api.npmjs.org/downloads` instead.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://npm.api.trendsapi.ai/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http npm-trends-api https://npm.api.trendsapi.ai/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add npm-trends-api --url https://npm.api.trendsapi.ai/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "npm-trends-api": {
            "url": "https://npm.api.trendsapi.ai/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "npm-trends-api": {
            "type": "http",
            "url": "https://npm.api.trendsapi.ai/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http npm-trends-api https://npm.api.trendsapi.ai/mcp
```

## When to use it
- check package download trends over the past 12 months
- measure adoption growth before adopting a new dependency
- spot declining interest in legacy JavaScript libraries
- inspect normalized npm popularity indexes directly inside the agent

## Example prompts
- Check the 12M download growth rate for the vite package.
- Pull the normalized popularity time series for @tanstack/react-query.
- Compare 3M and 1Y adoption trends between zustand and redux.

## Similar
- [TikTok Trends API](https://affpapa.org/en/nevibecode/mcp/tiktok-trends-api.md) — MCP server · ★ 3 repo stars
- [YouTube Trends API](https://affpapa.org/en/nevibecode/mcp/youtube-trends-api.md) — MCP server · ★ 1 repo stars
- [npm Trends MCP](https://affpapa.org/en/nevibecode/mcp/npm-trends-mcp.md) — MCP server
- [Google Trends MCP](https://affpapa.org/en/nevibecode/mcp/google-trends-mcp.md) — MCP server · ★ 17 repo stars
- [x-trends](https://affpapa.org/en/nevibecode/skills/x-trends.md) — skill · 190 installs
- [HasData Google Trends](https://affpapa.org/en/nevibecode/mcp/hasdata-google-trends.md) — MCP server · ★ 5 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
