# PyPI API

> PyPI returns package details, versions, and search results, available as a workflow and API.

Get package returns current and recent versions, release dates, and metadata from a package name or PyPI link. Search packages finds package names, descriptions, versions, and release dates from keywords, with an optional result count.

- Page: https://fous.com/workflows/pypi
- Handle: `@pypi`
- Category: [Developer tools](https://fous.com/workflows/category/developer-tools)
- Source website: https://pypi.org
- Last verified: Sep 30, 2026
- Fous is not affiliated with PyPI.

## Methods

### Get package

Operation `get_package`, version 1. 1 credit per call.

Get a PyPI package’s current version, release date, metadata, project links, and 10 most recently published versions from its name or PyPI link. Release dates use the first available file upload for each version; packages without files may have no release date.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `package` | string | yes | `"requests"` | Package name or PyPI package link, such as requests or https://pypi.org/project/requests/. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "package"
  ],
  "properties": {
    "package": {
      "type": "string",
      "description": "Package name or PyPI package link, such as requests or https://pypi.org/project/requests/.",
      "examples": [
        "requests",
        "https://pypi.org/project/Flask/",
        "httpx"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "package": "requests"
    },
    {
      "package": "https://pypi.org/project/Flask/"
    },
    {
      "package": "httpx"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `name` | string | `"requests"` | Package name as listed by PyPI. |
| `author` | string or null | `"Kenneth Reitz"` | Package author, if given. |
| `license` | string or null | `"Apache-2.0"` | License text or expression, if given. |
| `summary` | string or null | `"Python HTTP for Humans."` | Short description of the package. |
| `homepage` | string or null | `"https://github.com/encode/httpx"` | Project homepage, if given. |
| `pypi_page` | string | `"https://pypi.org/project/requests/"` | Public PyPI package page. |
| `maintainers` | array |  | Package maintainers listed in package metadata. |
| `source_code` | string or null | `"https://github.com/psf/requests"` | Project source code link, if given. |
| `latest_version` | string | `"2.34.2"` | Current version chosen by PyPI. |
| `last_10_versions` | array |  | Ten most recently uploaded versions with known release dates, newest first. |
| `last_10_versions[].version` | string | `"2.34.2"` |  |
| `last_10_versions[].pypi_page` | string | `"https://pypi.org/project/requests/2.34.2/"` | PyPI page for this version. |
| `last_10_versions[].release_date` | string | `"2026-05-14"` |  |
| `latest_release_date` | string or null | `"2026-05-14"` | Date the current version was first uploaded, if available. |
| `supported_python_versions` | string or null | `">=3.10"` | Python version requirement, such as >=3.8. |

**Example input**

```json
{
  "package": "requests"
}
```

**Example output**

```json
{
  "name": "requests",
  "author": "Kenneth Reitz",
  "license": "Apache-2.0",
  "summary": "Python HTTP for Humans.",
  "homepage": null,
  "pypi_page": "https://pypi.org/project/requests/",
  "maintainers": [
    "Ian Stapleton Cordasco",
    "Nate Prewitt"
  ],
  "source_code": "https://github.com/psf/requests",
  "latest_version": "2.34.2",
  "last_10_versions": [
    {
      "version": "2.34.2",
      "pypi_page": "https://pypi.org/project/requests/2.34.2/",
      "release_date": "2026-05-14"
    },
    {
      "version": "2.34.1",
      "pypi_page": "https://pypi.org/project/requests/2.34.1/",
      "release_date": "2026-05-13"
    },
    {
      "version": "2.34.0",
      "pypi_page": "https://pypi.org/project/requests/2.34.0/",
      "release_date": "2026-05-11"
    }
  ],
  "latest_release_date": "2026-05-14",
  "supported_python_versions": ">=3.10"
}
```

### Search packages

Operation `search_packages`, version 1. 1 credit per call.

Find PyPI packages by keywords in relevance order, with each package’s latest version and release date. Returns up to 100 results.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `query` | string | yes | `"requests"` | Keywords to find packages, for example pdf parsing. |
| `max_results` | integer | no | `3` | Maximum packages to return, for example 25. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Keywords to find packages, for example pdf parsing.",
      "examples": [
        "requests",
        "zzqvplmnopkfidghetrc",
        "pdf parsing"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum packages to return, for example 25.",
      "x-fous-developer": true,
      "examples": [
        3,
        25
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "query": "requests",
      "max_results": 3
    },
    {
      "query": "zzqvplmnopkfidghetrc"
    },
    {
      "query": "pdf parsing",
      "max_results": 25
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `packages` | array |  |  |
| `packages[].name` | string | `"requests"` |  |
| `packages[].pypi_link` | string | `"https://pypi.org/project/requests/"` |  |
| `packages[].description` | string or null | `"Python HTTP for Humans."` |  |
| `packages[].release_date` | string or null | `"2026-05-14"` |  |
| `packages[].latest_version` | string or null | `"2.34.2"` |  |

**Example input**

```json
{
  "query": "requests",
  "max_results": 3
}
```

**Example output**

```json
{
  "packages": [
    {
      "name": "requests",
      "pypi_link": "https://pypi.org/project/requests/",
      "description": "Python HTTP for Humans.",
      "release_date": "2026-05-14",
      "latest_version": "2.34.2"
    },
    {
      "name": "scrapy-requests",
      "pypi_link": "https://pypi.org/project/scrapy-requests/",
      "description": "Scrapy with requests-html",
      "release_date": "2021-03-19",
      "latest_version": "0.2.0"
    },
    {
      "name": "selenium-requests",
      "pypi_link": "https://pypi.org/project/selenium-requests/",
      "description": "Extends Selenium WebDriver classes to include the request function from the Requests library, while doing all the needed cookie and request headers handling.",
      "release_date": "2024-02-29",
      "latest_version": "2.0.4"
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@pypi",
  "visibility": "public",
  "operation": "get_package",
  "version": 1,
  "input": {
    "package": "requests"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@pypi\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_package\",\n  \"version\": 1,\n  \"input\": {\n    \"package\": \"requests\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@pypi",
  "visibility": "public",
  "operation": "get_package",
  "version": 1,
  "input": {
    "package": "requests"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@pypi","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare recent releases of Python packages
- Review package licenses and maintainers
- Find packages for a technical task
- Check package Python version requirements
- Track current versions of selected packages

## FAQ

### Is Fous affiliated with PyPI?

No. Fous is not affiliated with PyPI. This workflow reads the public pypi.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a PyPI account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from pypi.org when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 30, 2026.

### What is the current version of a package?

Get package returns the current version for a package name or PyPI link.

### When was a package version released?

Get package returns recent version release dates when available. Search packages returns release dates for matching packages.

### Which packages match these keywords?

Search packages finds packages by keywords and returns their descriptions, latest versions, and release dates.

## Related

- [npm API](https://fous.com/workflows/npm.md): npm provides package details, search results and latest versions, plus weekly download and publish data; daily and historical download counts may lag by a day or more.
- [NuGet API](https://fous.com/workflows/nuget.md): The .NET package gallery for discovering and sharing packages.
- [RubyGems API](https://fous.com/workflows/rubygems.md): Discover and share Ruby gems.
- [crates.io API](https://fous.com/workflows/crates-io.md): crates.io is the Rust community package registry, returning current crate details and recent releases or up to 100 keyword-matched crates with version, download, and update information.
- [Pinterest API](https://fous.com/workflows/pinterest.md): Pinterest helps people discover and save visual ideas, returning public search results from the first page and visible profile boards, with monthly views only when shown.
- [WordPress.org API](https://fous.com/workflows/wordpress-org.md): WordPress.org’s public plugin directory returns up to 100 ranked search matches with ratings, installations, compatibility and links, plus best-match details and the latest-version changelog when available.
- [GitHub API](https://fous.com/workflows/github.md): GitHub returns public repository matches and details, up to 25 trending projects, issues, pull requests, and newest-first published releases; release or commit dates may be unavailable.
- [Product Hunt API](https://fous.com/workflows/product-hunt.md): Product Hunt provides Pacific-time daily launches, product search, and profiles with reviews, alternatives, and 10 recent launches; ratings may be missing without reviews.
- [All Developer tools workflows](https://fous.com/workflows/category/developer-tools)
