# PyPI API

> Returns Python project metadata, releases, versions, and download statistics by day, period and Python version.

Category: Developer & Tech. Region: global. 9 endpoints at `https://api.hoshime.com/v1/pypi/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/pypi
## GET /v1/pypi/package

Latest version, licence, links and the 10 newest releases of one project.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `homepage` (string), `keywords` (Label[]), `keywords[].name` (string), `license` (string), `name` (string), `projectUrls` (map), `releases` (Release[]), `releases[].uploadTime` (string), `releases[].version` (string), `requiresPython` (string), `summary` (string), `url` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/pypi/package?name=requests" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/stats

Downloads of one project in the last day, week and month, from pypistats (mirrors excluded).

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `lastDay` (integer (int64)), `lastMonth` (integer (int64)), `lastWeek` (integer (int64)), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/pypi/stats?name=requests" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/release

One release of a project: its metadata and every file of it with the sha256 digest. The latest release when no version is given.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `version` | string | no | Release version, such as 2.32.3. Default the latest release. (e.g. 2.32.3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `files` (ReleaseFile[]), `files[].filename` (string), `files[].packageType` (string), `files[].pythonVersion` (string), `files[].sha256` (string), `files[].size` (integer (int64)), `files[].uploadTime` (string), `files[].url` (string), `files[].yanked` (boolean), `license` (string), `name` (string), `requiresPython` (string), `summary` (string), `url` (string), `version` (string), `yanked` (boolean)

```bash
curl "https://api.hoshime.com/v1/pypi/release?name=requests&version=2.32.3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/versions

Every release of one project that has files, newest first, 30 per page, with the upload time of its first file.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `uploadTime` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/pypi/versions?name=requests" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/overallDownloads

Daily downloads of one project for the last 180 days from pypistats, mirrors excluded, with their total.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `daily` (DailyCount[]), `daily[].date` (string), `daily[].downloads` (integer (int64)), `name` (string), `total` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/pypi/overallDownloads?name=requests" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/pythonVersions

Downloads of one project by Python minor version (3.12, 3.13, …) over the last 180 days from pypistats, mirrors excluded, largest first.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `items` (Count[]), `items[].downloads` (integer (int64)), `items[].name` (string), `name` (string), `total` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/pypi/pythonVersions?name=requests" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/systems

Downloads of one project by operating system (Linux, Windows, Darwin, …) over the last 180 days from pypistats, mirrors excluded, largest first.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Project name, or pypi.org project URL. (e.g. requests) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `items` (Count[]), `items[].downloads` (integer (int64)), `items[].name` (string), `name` (string), `total` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/pypi/systems?name=requests" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/newPackages

Newest packages registered on PyPI, with their first version and description, from its public feed.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `id` (string), `imageUrl` (string), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/pypi/newPackages" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pypi/recentUpdates

Releases uploaded to PyPI most recently, newest first, from its public feed.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 30) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `id` (string), `imageUrl` (string), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/pypi/recentUpdates" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
