# npm Package

Returns one npm package version: description, license, repository, keywords, author, maintainers, funding, scripts, engines, dependencies, dev, peer and optional dependencies, dist info (tarball, integrity, size, file count), weekly and monthly downloads, the version list with release dates, dist-tags and the readme. Scoped names such as @types/node work. version accepts a version or a dist-tag and defaults to latest. The readme comes from the latest release. A package with a very large history returns packument_truncated=true without the version list. Unknown packages and versions answer 404. Costs 1 credit per successful request.

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

## 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 |
| --- | --- | --- | --- |
| `package` | string | Yes | Package name, scoped names allowed, e.g. lodash or @types/node. |
| `version` | string | No | Version or dist-tag. Defaults to latest. |
| `include_versions` | boolean | No | Include the version list, release dates and dist-tags. Defaults to true. |
| `include_readme` | boolean | No | Include the readme. Defaults to true. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/npm/package?package=lodash"
```

## Example response

```json
{
    "success": true,
    "data": {
        "name": "lodash",
        "version": "4.17.21",
        "description": "Lodash modular utilities.",
        "license": "MIT",
        "homepage": "https://lodash.com/",
        "repository": {
            "url": "git+https://github.com/lodash/lodash.git",
            "type": "git"
        },
        "bugs": {
            "url": "https://github.com/lodash/lodash/issues"
        },
        "keywords": [
            "modules",
            "stdlib"
        ],
        "author": {
            "name": "John-David Dalton",
            "email": "john.david.dalton@gmail.com"
        },
        "contributors": [
            {
                "name": "John-David Dalton",
                "email": "john.david.dalton@gmail.com"
            },
            {
                "name": "Mathias Bynens",
                "email": "mathias@qiwi.be"
            }
        ],
        "maintainers": [
            {
                "name": "mathias",
                "email": "mathias@qiwi.be"
            },
            {
                "name": "jdalton",
                "email": "john.david.dalton@gmail.com"
            }
        ],
        "main": "lodash.js",
        "scripts": {
            "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\""
        },
        "dependencies": [],
        "dev_dependencies": [],
        "peer_dependencies": [],
        "optional_dependencies": [],
        "dist": {
            "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
            "shasum": "ff2b66c1f6326d59513de2407bf881439812771c",
            "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
            "unpacked_size": 1413741,
            "file_count": 1051
        },
        "downloads": {
            "last_week": 194304902,
            "last_month": 571038333
        },
        "created_at": "2015-02-24T05:53:13.392Z",
        "modified_at": "2026-04-14T14:26:11.557Z",
        "dist_tags": {
            "latest": "3.0.1"
        },
        "versions": [
            {
                "version": "0.1.0",
                "published_at": "2015-02-24T05:53:13.392Z"
            },
            {
                "version": "0.1.1",
                "published_at": "2016-12-07T07:18:01.205Z"
            }
        ]
    },
    "meta": {
        "endpoint_family": "package",
        "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. |
| 404 | Not Found | The source has no such public resource. 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)
