# pub.dev API

> Returns pub.dev Dart and Flutter packages by search or list, with versions, scores and security advisories.

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

pub.dev packages matching a search, one page at a time.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as http. (e.g. http) |
| `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), `url` (string)

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

## GET /v1/pubdev/package

One pub.dev package: its latest version, description and recent versions.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name, such as http. (e.g. http) |
| `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), `homepage` (string), `name` (string), `publishedAt` (string), `repository` (string), `version` (string), `versions` (string[])

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

## GET /v1/pubdev/score

The pub.dev score of a package: granted and maximum points, likes and downloads.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name, such as http. (e.g. http) |
| `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: `downloadCount30Days` (integer (int64)), `grantedPoints` (integer (int64)), `likeCount` (integer (int64)), `maxPoints` (integer (int64)), `name` (string), `tags` (string[])

```bash
curl "https://api.hoshime.com/v1/pubdev/score?name=http" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pubdev/version

One pub.dev package version: its dependencies, SDK constraint and archive checksum.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name, such as http. (e.g. http) |
| `version` | string | yes | Version, such as 1.2.2. (e.g. 1.2.2) |
| `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: `archiveSha256` (string), `archiveUrl` (string), `dependencies` (map), `description` (string), `name` (string), `publishedAt` (string), `repository` (string), `sdk` (string), `topics` (string[]), `version` (string)

```bash
curl "https://api.hoshime.com/v1/pubdev/version?name=http&version=1.2.2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pubdev/advisories

Security advisories that pub.dev lists for a package.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name, such as http. (e.g. http) |
| `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: `advisoriesUpdatedAt` (string), `aliases` (string[]), `id` (string), `publishedAt` (string), `summary` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/pubdev/advisories?name=http" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pubdev/list

pub.dev packages in the registry's own order, 100 per page, with their latest version. Page with cursor.

Scope: `social:read` · Units: 1 · Cached: 30 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), `name` (string), `publishedAt` (string), `version` (string)

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

## GET /v1/pubdev/versions

Every version of one pub.dev package, oldest first, with the time each was published, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name, such as http. (e.g. http) |
| `limit` | integer | no | Items per page, 1 to 200. (default 50) |
| `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: `publishedAt` (string), `version` (string)

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

## GET /v1/pubdev/packagePublisher

The verified publisher of one pub.dev package, such as dart.dev, with the publisher's description and website.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Package name, such as http. (e.g. http) |
| `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), `id` (string), `websiteUrl` (string)

```bash
curl "https://api.hoshime.com/v1/pubdev/packagePublisher?name=http" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
