# Snapcraft API

> Returns Snap Store listings: snap info with channel revisions, search results, categories, details and lookups by common id.

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

One snap: its title, publisher, license and the revision of every channel.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Snap name, such as firefox. (e.g. firefox) |
| `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: `channels` (Channel[]), `channels[].architecture` (string), `channels[].released` (string), `channels[].revision` (integer (int64)), `channels[].risk` (string), `channels[].track` (string), `channels[].version` (string), `id` (string), `license` (string), `name` (string), `publisher` (string), `storeUrl` (string), `summary` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/snapcraft/info?name=firefox" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snapcraft/find

Snaps in the Snap Store matching a search.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as firefox. (e.g. firefox) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `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: `id` (string), `license` (string), `name` (string), `publisher` (string), `summary` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/snapcraft/find?query=firefox" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snapcraft/category

Snaps of one Snap Store category, such as games or development, in the order the store lists them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `category` | string | yes | Category name, such as games, development or productivity. (e.g. games) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `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: `id` (string), `license` (string), `name` (string), `publisher` (string), `summary` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/snapcraft/category?category=games" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snapcraft/details

One snap's public listing: description, categories, links, screenshots and store page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Snap name, such as firefox. (e.g. firefox) |
| `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: `categories` (Category[]), `categories[].name` (string), `description` (string), `iconUrl` (string), `license` (string), `links` (map), `name` (string), `screenshots` (Image[]), `screenshots[].height` (any), `screenshots[].url` (string), `screenshots[].width` (any), `storeUrl` (string), `summary` (string), `title` (string), `website` (string)

```bash
curl "https://api.hoshime.com/v1/snapcraft/details?name=firefox" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snapcraft/byCommonId

The snaps that declare a desktop app's common id, such as org.mozilla.firefox.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `commonId` | string | yes | Common id, such as org.mozilla.firefox. (e.g. org.mozilla.firefox) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `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: `id` (string), `license` (string), `name` (string), `publisher` (string), `summary` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/snapcraft/byCommonId?commonId=org.mozilla.firefox" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/snapcraft/publisher

The snaps one publisher has published in the Snap Store, such as the snaps of canonical.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `publisher` | string | yes | Publisher username, such as canonical. (e.g. canonical) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `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: `id` (string), `license` (string), `name` (string), `publisher` (string), `summary` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/snapcraft/publisher?publisher=canonical" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
