# Python — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access comprehensive Python release information including downloads, versions, and supported operating systems, plus stay updated with the latest Python news and events. Search across Python.org's resources and browse release files, details, and the FTP index all in one place.

**Category:** Developer Tools | **Website:** [python.org/](https://python.org/) | **Docs:** [parse.bot/marketplace/4714846d-ee2d-4557-807d-b894a1e2fd00/python-org-api](https://parse.bot/marketplace/4714846d-ee2d-4557-807d-b894a1e2fd00/python-org-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/python/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get active release versions

Returns the active Python release versions list from the downloads page, including maintenance status, first release date, and end-of-support date. Only versions currently tracked by python.org are shown (typically active and recently-EOL versions).

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-active-release-versions \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get all release files

Returns all downloadable release files from the python.org API across all releases. This is a large response containing every file ever published. Each file includes its download URL, checksum, size, and associated release/OS references.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-all-release-files \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get all releases

Returns all Python releases from the python.org API. Each release includes version metadata, release dates, and resource URIs. The full list is returned in a single page and includes both Python 2.x and 3.x releases across all states (published, pre-release, etc.).

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-all-releases \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get events

Returns upcoming Python events from python.org/events/. Each event includes its name, URL, date range, and location. Only future/current events are shown as maintained by the Python community.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-events \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get ftp index

Returns the directory listing from the Python FTP site at python.org/ftp/python/. Supports subdirectory navigation via the path parameter. Each entry is a file or directory name with its full URL.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `path` | string | No | Subdirectory path (e.g. '3.12.0/'). Empty string returns the root listing. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-ftp-index \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"path":"<string>"}'
```

### Get latest release

Returns the latest stable Python 3.x release by finding the highest published, non-pre-release version. Useful for checking the current recommended Python version without parsing the full release list.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-latest-release \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get news

Returns latest Python news from the blog page at python.org/blogs/. Includes article title, URL, publication date, and summary text. Results reflect the current front page of the Python blog.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-news \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get release by id

Returns a single Python release record by its numeric ID. The ID is the trailing integer from the resource_uri field of a release (e.g. '1090' from '/api/v2/downloads/release/1090/'). Returns input_not_found for IDs that do not exist.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | Yes | Numeric release ID (e.g. '1090', '146') |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-release-by-id \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"id":"<string>"}'
```

### Get release detail page

Scrapes an individual release detail page for title, release date, and downloadable files with checksums. Works for modern Python 3.x releases that have detail pages. Returns input_not_found for releases without detail pages or invalid slugs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `version_slug` | string | Yes | Version slug like 'python-3120' or version number like '3.12.0' |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-release-detail-page \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"version_slug":"<string>"}'
```

### Get release files by release

Returns all downloadable files for a specific Python release. Accepts a numeric release ID (the trailing integer from a release's resource_uri) or a full resource URI path. Each file includes download URL, checksum, size, and OS classification.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `release_uri` | string | Yes | Release numeric ID (e.g. '1090') or full resource URI path (e.g. '/api/v2/downloads/release/1090/') |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-release-files-by-release \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"release_uri":"<string>"}'
```

### Get releases for os

Returns stable releases and pre-releases for a specific operating system by scraping the OS-specific downloads page. Each release includes its name, release page URL, date, and per-OS download links with labels.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `os_slug` | string | No | OS slug: 'windows', 'macos', or 'source' |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-releases-for-os \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"os_slug":"<string>"}'
```

### Get supported os list

Returns the list of supported operating systems from the python.org API. Each OS entry includes a display name, URL-safe slug, and API resource URI that can be used to filter release files.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/get-supported-os-list \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Search

Performs a site search on python.org. Returns matching pages with titles, URLs, and text snippets. Coverage depends on the site's search index; some queries may return empty results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query string |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/python/search \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.