# 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/tools/pypi
- Handle: `@pypi`
- Category: [Developer tools](https://fous.com/tools/category/developer-tools)
- Source website: https://pypi.org
- Last verified: Sep 30, 2026

## Methods

### Get package

Operation `get_package`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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 completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_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.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/pypi`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_package`: Get package. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_packages`: Search packages. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-pypi https://api.fous.com/mcp/tools/pypi --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## 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

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this PyPI tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. 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. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified 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/tools/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/tools/nuget.md): The .NET package gallery for discovering and sharing packages.
- [RubyGems API](https://fous.com/tools/rubygems.md): Discover and share Ruby gems.
- [crates.io API](https://fous.com/tools/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/tools/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/tools/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/tools/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/tools/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 tools](https://fous.com/tools/category/developer-tools)
