# Packagist API

> Returns Composer package details, search results, versions, download statistics, popular packages and overall Packagist statistics.

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

Latest stable version, licence, authors, downloads and stars of one Composer package.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name as vendor/name, or packagist.org package URL. (e.g. monolog/monolog) |
| `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: `authors` (Author[]), `authors[].avatarUrl` (string), `authors[].id` (string), `authors[].name` (string), `authors[].url` (string), `authors[].username` (string), `dependents` (integer (int64)), `description` (string), `downloadsMonthly` (integer (int64)), `downloadsTotal` (integer (int64)), `favers` (integer (int64)), `githubStars` (integer (int64)), `homepage` (string), `keywords` (Named[]), `keywords[].name` (string), `language` (string), `license` (Named[]), `license[].name` (string), `name` (string), `releasedAt` (string), `repository` (string), `type` (string), `url` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/packagist/package?name=monolog%2Fmonolog" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/packagist/search

Packages that match a search, 20 per page, as Packagist ranks them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms. (e.g. monolog) |
| `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: `description` (string), `downloads` (integer (int64)), `favers` (integer (int64)), `name` (string), `repository` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/packagist/search?query=monolog" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/packagist/versions

Every version of one Composer package, newest first, 30 per page, with its release time, licence and whether it is stable.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name as vendor/name, or packagist.org package URL. (e.g. monolog/monolog) |
| `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: `license` (Named[]), `license[].name` (string), `releasedAt` (string), `stable` (boolean), `type` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/packagist/versions?name=monolog%2Fmonolog" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/packagist/stats

Downloads of one Composer package in total, in the last 30 days and per day, with its version count.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name as vendor/name, or packagist.org package URL. (e.g. monolog/monolog) |
| `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` (integer (int64)), `date` (string), `monthly` (integer (int64)), `name` (string), `total` (integer (int64)), `versions` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/packagist/stats?name=monolog%2Fmonolog" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/packagist/popular

The most downloaded Composer packages on Packagist, 30 per page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `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: `description` (string), `downloads` (integer (int64)), `favers` (integer (int64)), `name` (string), `url` (string)

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

## GET /v1/packagist/advisories

Security advisories of one Composer package: title, CVE, the affected version ranges and the advisory link.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name as vendor/name, or packagist.org package URL. (e.g. symfony/http-kernel) |
| `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: `affectedVersions` (string), `cve` (string), `id` (string), `link` (string), `reportedAt` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/packagist/advisories?name=symfony%2Fhttp-kernel" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/packagist/statistics

Packagist as a whole: how many packages and versions it lists, and the downloads it has served.

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

| 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: `downloads` (integer (int64)), `packages` (integer (int64)), `versions` (integer (int64))

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

## GET /v1/packagist/vendorPackages

Names of the packages one vendor publishes on Packagist, 50 per page, in the order Packagist lists them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `vendor` | string | yes | Vendor name, such as monolog or laravel. (e.g. monolog) |
| `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: `name` (string)

```bash
curl "https://api.hoshime.com/v1/packagist/vendorPackages?vendor=monolog" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
