# npm Search

Searches the npm registry. Each result carries name, version, description, keywords, publish date, links, publisher, maintainers, the final, quality, popularity and maintenance scores, the search score, flags, weekly and monthly downloads and dependents count. total and has_more are exact. Costs 1 credit per successful request.

- **Documentation:** [https://scrappa.co/docs/npm-api/npm_search](https://scrappa.co/docs/npm-api/npm_search)
- **API group:** npm API
- **Endpoint:** `GET https://scrappa.co/api/npm/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `q` | string | Yes | Search text. Supports qualifiers such as keywords:react or author:sindresorhus. |
| `size` | integer | No | Results per page, 1-250. Defaults to 20. |
| `page` | integer | No | 1-based page. Defaults to 1. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/npm/search?q=express&size=20"
```

## Example response

```json
{
    "success": true,
    "data": {
        "search_parameters": {
            "q": "express"
        },
        "total": 77711,
        "page": 1,
        "size": 2,
        "has_more": true,
        "results": [
            {
                "name": "express",
                "version": "5.3.0",
                "description": "Fast, unopinionated, minimalist web framework",
                "keywords": [
                    "express"
                ],
                "published_at": "2026-10-09T12:56:54.505Z",
                "links": {
                    "homepage": "https://expressjs.com/",
                    "repository": "git+https://github.com/expressjs/express.git",
                    "bugs": "https://github.com/expressjs/express/issues",
                    "npm": "https://www.npmjs.com/package/express"
                },
                "publisher": {
                    "email": "npm-oidc-no-reply@github.com",
                    "approver": {
                        "name": "ulisesgascon",
                        "email": "ulisesgascondev@gmail.com"
                    },
                    "trustedPublisher": {
                        "oidcConfigId": "99dba195-afaa-4d25-9fac-f714da8caf90",
                        "id": "github"
                    },
                    "username": "GitHub Actions"
                },
                "maintainers": [
                    {
                        "email": "wes@wesleytodd.com",
                        "username": "wesleytodd"
                    }
                ],
                "score": {
                    "final": 2386.2888,
                    "quality": 1,
                    "popularity": 1,
                    "maintenance": 1
                },
                "search_score": 2386.2888,
                "flags": {
                    "insecure": 0
                },
                "downloads": {
                    "weekly": 194304902,
                    "monthly": 571038333
                },
                "dependents": 108836,
                "updated_at": "2026-11-03T18:53:23.729Z"
            }
        ]
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 503 | Upstream Unavailable | The source could not be fetched after the attempt budget. Never charged. Safe to retry. |
| 500 | Parser Drift | The source returned a shape this parser does not recognise. The incident is reported. Never charged. |
| 422 | Invalid Parameter | A value in this request is invalid or the requested page is out of range. Never charged. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
