Scraper APIPyPI
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.
- 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; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
packagerequired | string | 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 | Return this many of the project's releases, newest first; 0 returns none.Limit: 0 to 2000. Default: 20. |
include_description | boolean | true also returns the project's long description (its README) as written.Default: false. |
packageis 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_distandfilesare the latest version's.releasesis the newest first,max_releasesof them;release_countis how many there are in all.descriptionis the long description as written, in the formatdescription_content_typenames; it is returned only withinclude_description: true.downloads_last_day,downloads_last_weekanddownloads_last_monthare pypistats.org's figures: PyPI publishes none. A project without counts has themnull.authorandmaintainerare names. Email addresses are not returned.- A project PyPI does not have ends the run
failedwithnot_found, and costs nothing — see the reasons of this family.
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. |
version (in releases[]) | string | The release's version number, e.g. "2.32.3". |
uploaded_at (in releases[]) | string (date-time) or null | When the release's first file was uploaded, in UTC; null for a release without files. |
files (in releases[]) | integer | How many files (wheels and source archives) the release has.Default: 0. |
yanked (in releases[]) | 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. |
filename (in files[]) | string | The file's name, e.g. "requests-2.32.3-py3-none-any.whl". |
package_type (in files[]) | string or null | bdist_wheel for a wheel, sdist for a source archive. |
python_version (in files[]) | string or null | The Python the file is built for, as PyPI states it, e.g. "py3", "cp312", "source". |
size_bytes (in files[]) | integer or null | The file's size in bytes. |
url (in files[]) | string or null | The address the file downloads from. |
uploaded_at (in files[]) | string (date-time) or null | When the file was uploaded, in UTC. |
sha256 (in files[]) | 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
# Start a run and wait up to 60 seconds for it to finish
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}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("pypi.package", {
"package": "sampleproject",
"max_releases": 3,
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("pypi.package", {
package: "sampleproject",
max_releases: 3,
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "pypi.package", map[string]any{"package": "sampleproject", "max_releases": 3})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("pypi.package", Map.of("package", "sampleproject", "max_releases", 3));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run pypi.package --input package=sampleproject --input max_releases=3Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"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.
{
"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.
{
"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 lists every status and the reasons every scraper shares; the reasons of the PyPI scrapers are in their own section there.