# pypi.package

A project of the Python Package Index: summary, latest version, licence, Python requirement, dependencies, links, its releases with their dates, the latest files, and its download counts.

PyPI package, one of the PyPI scrapers.

| | |
| --- | --- |
| Id | `pypi.package` |
| Version | 1 |
| Billed per | request — 1 unit for a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/pypi.package/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `package` | string | yes | The project's name, e.g. requests or scikit-learn, or its address on pypi.org. Limit: at least 1 characters, at most 400 characters. |
| `max_releases` | integer | no | Return this many of the project's releases, newest first; 0 returns none. Limit: 0 to 2000. Default: `20`. |
| `include_description` | boolean | no | true also returns the project's long description (its README) as written. Default: `false`. |

- `package` is the project's name, in any of the spellings PyPI accepts (`Flask`, `flask`, `ruamel.yaml`), or its address on pypi.org.
- `version`, `requires_python`, `requires_dist` and `files` are the latest version's. `releases` is the newest first, `max_releases` of them; `release_count` is how many there are in all.
- `description` is the long description as written, in the format `description_content_type` names; it is returned only with `include_description: true`.
- `downloads_last_day`, `downloads_last_week` and `downloads_last_month` are pypistats.org's figures: PyPI publishes none. A project without counts has them `null`.
- `author` and `maintainer` are names. Email addresses are not returned.
- A project PyPI does not have ends the run `failed` with `not_found`, and costs nothing — see [the reasons of this family](https://docs.enrichednow.com/results-and-statuses.md#pypi).

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `name` | string | The project's name as PyPI writes it, e.g. "Flask". |
| `url` | string | The project's page on pypi.org. |
| `version` | string or null | The latest version. |
| `summary` | string or null | The project's one-line summary. |
| `description` | string or null | The project's long description (its README) as written, when include_description asked for it. |
| `description_content_type` | string or null | The format of the long description, e.g. "text/markdown", "text/x-rst". |
| `author` | string or null | The author's name as the project's metadata states it. |
| `maintainer` | string or null | The maintainer's name as the project's metadata states it; null when it names none. |
| `license` | string or null | The licence: the expression or short name the metadata states, else the licence its classifiers name. |
| `keywords` | array of string | The project's keywords. |
| `classifiers` | array of string | The project's trove classifiers, e.g. "Programming Language :: Python :: 3.12". |
| `requires_python` | string or null | The Python versions the latest release supports, e.g. ">=3.9". |
| `requires_dist` | array of string | The latest release's dependencies as requirement strings, extras included, e.g. "urllib3<3,>=1.21.1". |
| `project_urls` | object of string values | The links the project names, by label, e.g. {"Documentation": "https://…", "Source": "https://…"}. |
| `homepage` | string or null | The project's home page, when it names one. |
| `yanked` | boolean | True when the latest release was withdrawn by its maintainers. Default: `false`. |
| `yanked_reason` | string or null | The reason the maintainers gave for withdrawing it. |
| `release_count` | integer | How many releases the project has. Default: `0`. |
| `releases` | array of object | The newest releases first, as many as max_releases asked for. |
| `releases[].version` | string | The release's version number, e.g. "2.32.3". |
| `releases[].uploaded_at` | string (date-time) or null | When the release's first file was uploaded, in UTC; null for a release without files. |
| `releases[].files` | integer | How many files (wheels and source archives) the release has. Default: `0`. |
| `releases[].yanked` | boolean | True when the maintainers withdrew the release. Default: `false`. |
| `first_uploaded_at` | string (date-time) or null | When the project's first file was uploaded, in UTC. |
| `latest_uploaded_at` | string (date-time) or null | When the latest version was uploaded, in UTC. |
| `files` | array of object | The files of the latest version. |
| `files[].filename` | string | The file's name, e.g. "requests-2.32.3-py3-none-any.whl". |
| `files[].package_type` | string or null | bdist_wheel for a wheel, sdist for a source archive. |
| `files[].python_version` | string or null | The Python the file is built for, as PyPI states it, e.g. "py3", "cp312", "source". |
| `files[].size_bytes` | integer or null | The file's size in bytes. |
| `files[].url` | string or null | The address the file downloads from. |
| `files[].uploaded_at` | string (date-time) or null | When the file was uploaded, in UTC. |
| `files[].sha256` | string or null | The file's SHA-256 digest. |
| `vulnerabilities` | array of string | The identifiers of the known vulnerabilities PyPI lists for the latest version, e.g. "GHSA-…", "PYSEC-…". Empty when it lists none. |
| `downloads_last_day` | integer or null | Downloads on the last day counted, as pypistats.org states them. |
| `downloads_last_week` | integer or null | Downloads in the last seven days counted. |
| `downloads_last_month` | integer or null | Downloads in the last thirty days counted. |
| `fetched_at` | string (date-time) | When the project was read, in UTC. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/pypi.package/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"package":"sampleproject","max_releases":3}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "pypi.package",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "package": "sampleproject",
    "max_releases": 3
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": 1,
  "units_per_record": null,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "name": "sampleproject",
      "url": "https://pypi.org/project/sampleproject/",
      "version": "4.0.0",
      "summary": "A sample Python project",
      "description": null,
      "description_content_type": "text/markdown",
      "author": "A. Random Developer",
      "maintainer": "A. Great Maintainer",
      "license": "MIT License",
      "keywords": [
        "sample",
        "setuptools",
        "development"
      ],
      "classifiers": [
        "Development Status :: 3 - Alpha",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License"
      ],
      "requires_python": ">=3.9",
      "requires_dist": [
        "peppercorn",
        "check-manifest; extra == \"dev\"",
        "coverage; extra == \"test\""
      ],
      "project_urls": {
        "Bug Reports": "https://github.com/pypa/sampleproject/issues",
        "Funding": "https://donate.pypi.org",
        "Homepage": "https://github.com/pypa/sampleproject",
        "Say Thanks!": "http://saythanks.io/to/example",
        "Source": "https://github.com/pypa/sampleproject/"
      },
      "homepage": "https://github.com/pypa/sampleproject",
      "yanked": false,
      "yanked_reason": null,
      "release_count": 7,
      "releases": [
        {
          "version": "4.0.0",
          "uploaded_at": "2024-11-06T22:37:09.220617Z",
          "files": 2,
          "yanked": false
        },
        {
          "version": "3.0.0",
          "uploaded_at": "2022-12-01T18:51:00.007372Z",
          "files": 2,
          "yanked": false
        }
      ],
      "first_uploaded_at": "2015-06-14T14:37:56.383366Z",
      "latest_uploaded_at": "2024-11-06T22:37:09.220617Z",
      "files": [
        {
          "filename": "sampleproject-4.0.0-py3-none-any.whl",
          "package_type": "bdist_wheel",
          "python_version": "py3",
          "size_bytes": 4661,
          "url": "https://files.pythonhosted.org/packages/d7/73/c16e5f3f0d37c60947e70865c255a58dc408780a6474de0523afd0ec553a/sampleproject-4.0.0-py3-none-any.whl",
          "uploaded_at": "2024-11-06T22:37:09.220617Z",
          "sha256": "c23e447ea90d796d1e645c35c4b2de125040add12a845825546f91c93f391b6b"
        },
        {
          "filename": "sampleproject-4.0.0.tar.gz",
          "package_type": "sdist",
          "python_version": "source",
          "size_bytes": 5760,
          "url": "https://files.pythonhosted.org/packages/48/8c/c18d25735962870ccb6d1cd2ac7bde40008a332211055e260cb7ec4c6bab/sampleproject-4.0.0.tar.gz",
          "uploaded_at": "2024-11-06T22:37:10.868088Z",
          "sha256": "0ace7980f82c5815ede4cd7bf9f6693684cec2ae47b9b7ade9add533b8627c6b"
        }
      ],
      "vulnerabilities": [],
      "downloads_last_day": 16542,
      "downloads_last_week": 119851,
      "downloads_last_month": 505681,
      "fetched_at": "2026-11-19T18:07:41.099216Z"
    }
  ],
  "next_cursor": null
}
```

What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with `… [truncated]`.

- Shortened: `classifiers`: 11 items, the first 3 shown.
- Shortened: `releases`: 3 items, the first 2 shown.

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the PyPI scrapers](https://docs.enrichednow.com/results-and-statuses.md#pypi) are in their own section there.
