# npm Registry API
> Everything about npm packages in one clean API. Look up a package’s latest metadata — version, description, license, homepage, repository, author, keywords, dist-tags, dependencies and maintainers — list its full version history with release dates, pull download statistics for the last day, week, month or year, and search the registry across more than three million packages. Sourced live from the public npm registry and returned as tidy JSON through a fast, reliable API. Ideal for developer dashboards and tooling, package and dependency analytics, supply-chain and security checks, CI/CD and documentation sites.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/npm-api/..."
```

## Pricing
- **Free** (Free) — 5,000 calls/Mo, 2 req/s
- **Basic** ($3/Mo) — 60,000 calls/Mo, 5 req/s
- **Pro** ($12/Mo) — 400,000 calls/Mo, 15 req/s
- **Mega** ($32/Mo) — 2,000,000 calls/Mo, 40 req/s

## Endpoints

### npm

#### `GET /v1/downloads` — Download statistics

**Parameters:**
- `name` (query, required, string) — Package name Example: `lodash`
- `period` (query, optional, string) — last-day | last-week | last-month | last-year Example: `last-month`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/npm-api/v1/downloads?name=lodash&period=last-month"
```

**Response:**
```json
{
    "data": {
        "end": "2026-05-29",
        "name": "lodash",
        "start": "2026-04-30",
        "period": "last-month",
        "downloads": 650868178
    },
    "meta": {
        "timestamp": "2026-05-30T18:16:50.220Z",
        "request_id": "63d67709-06d7-4151-9a7c-68b44534e874"
    },
    "status": "ok",
    "message": "Downloads retrieved",
    "success": true
}
```

#### `GET /v1/package` — Package metadata

**Parameters:**
- `name` (query, required, string) — Package name (scoped ok, e.g. @types/node) Example: `express`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/npm-api/v1/package?name=express"
```

**Response:**
```json
{
    "data": {
        "name": "express",
        "author": "TJ Holowaychuk",
        "created": "2010-12-29T19:38:25.450Z",
        "license": "MIT",
        "npm_url": "https://www.npmjs.com/package/express",
        "homepage": "https://expressjs.com/",
        "keywords": [
            "express",
            "framework",
            "sinatra",
            "web",
            "http",
            "rest",
            "restful",
            "router",
            "app",
            "api"
        ],
        "modified": "2026-05-19T12:28:53.443Z",
        "dist_tags": {
            "latest": "5.2.1",
            "latest-4": "4.22.2"
        },
        "repository": "https://github.com/expressjs/express",
        "description": "Fast, unopinionated, minimalist web framework",
        "maintainers": [
            "wesleytodd",
            "jonchurch",
            "ctcpip",
            "ulisesgascon",
            "sheplu"
        ],
        "dependencies": {
            "qs": "^6.14.0",
            "depd": "^2.0.0",
            "etag": "^1.8.1",
            "once": "^1.4.0",
            "send": "^1.1.0",
            "vary": "^1.1.2",
            "debug": "^4.4.0",
            "fresh": "^2.0.0",
            "cookie": "^0.7.1",
            "router": "^2.2.0",
            "accepts": "^2.0.0",
            "type-is": "^2.0.1",
            "parseurl": "^1.3.3",
            "statuses": "^2.0.1",
            "encodeurl": "^2.0.0",
            "mime-types": "^3.0.0",
            "proxy-addr
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search the registry

**Parameters:**
- `q` (query, required, string) — Search terms Example: `test framework`
- `limit` (query, optional, string) — 1-50 (default 10) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/npm-api/v1/search?q=test+framework&limit=10"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "query": "test framework",
        "total": 457412,
        "results": [
            {
                "date": "2026-05-21T11:11:59.551Z",
                "name": "mocha",
                "links": {
                    "npm": "https://www.npmjs.com/package/mocha",
                    "bugs": "https://github.com/mochajs/mocha/issues/",
                    "homepage": "https://mochajs.org/",
                    "repository": "git+https://github.com/mochajs/mocha.git"
                },
                "score": 463.619,
                "version": "11.7.6",
                "keywords": [
                    "mocha",
                    "test",
                    "bdd",
                    "tdd",
                    "tap",
                    "testing",
                    "chai",
                    "assertion",
                    "ava",
                    "jest",
                    "tape",
                    "jasmine",
                    "karma"
                ],
                "publisher": "joshuakgoldberg",
                "description": "simple, flexible, fun test framework"
            },
            {
                "date": "2018-07-30T13:57:31.472Z",
                "name": "should",
                "links": {
                    "npm": "https://www.npmjs.com/package/should",
                    "bugs": "https://github.com/shouldjs/should.js/issues",
                    "homepage": "https://github.com/shouldjs/should.js"
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/versions` — Version history

**Parameters:**
- `name` (query, required, string) — Package name Example: `react`
- `limit` (query, optional, string) — 1-1000 (default 100) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/npm-api/v1/versions?name=react&limit=100"
```

**Response:**
```json
{
    "data": {
        "name": "react",
        "total": 2812,
        "latest": "19.2.6",
        "versions": [
            {
                "version": "0.0.0-experimental-f0dfee38-20260529",
                "released": "2026-05-29T18:04:30.566Z"
            },
            {
                "version": "19.3.0-canary-f0dfee38-20260529",
                "released": "2026-05-29T18:03:01.274Z"
            },
            {
                "version": "0.0.0-experimental-6b5ea125-20260528",
                "released": "2026-05-28T17:29:37.019Z"
            },
            {
                "version": "19.3.0-canary-6b5ea125-20260528",
                "released": "2026-05-28T17:28:00.869Z"
            },
            {
                "version": "0.0.0-experimental-c0cd4d5d-20260527",
                "released": "2026-05-27T17:19:56.607Z"
            },
            {
                "version": "19.3.0-canary-c0cd4d5d-20260527",
                "released": "2026-05-27T17:18:14.237Z"
            },
            {
                "version": "0.0.0-experimental-75b0945b-20260526",
                "released": "2026-05-26T17:19:54.857Z"
            },
            {
                "version": "19.3.0-canary-75b0945b-20260526",
                "released": "2026-05-26T17:18:39.786Z"
            },
            {
                "version": "0.0.0-experimental-d5736f09-20260507",
                "released": "2026-05-08T16:45:09.229Z"
            },
            {
                "version": "19.3.
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/npm-api
OpenAPI spec: https://www.oanor.com/api/npm-api/openapi.json
