# Homebrew API

> Returns Homebrew formulae and casks with versions and dependencies, plus install rankings and most frequent build errors.

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

One Homebrew formula: its description, stable version and dependencies.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Formula name, such as wget. (e.g. wget) |
| `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: `dependencies` (string[]), `description` (string), `fullName` (string), `homepage` (string), `license` (string), `name` (string), `stableVersion` (string), `tap` (string)

```bash
curl "https://api.hoshime.com/v1/homebrew/formula?name=wget" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/homebrew/cask

One Homebrew cask: a macOS app, its version, names and homepage.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `token` | string | yes | Cask token, 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: `autoUpdates` (boolean), `deprecated` (boolean), `description` (string), `disabled` (boolean), `homepage` (string), `names` (string[]), `sha256` (string), `tap` (string), `token` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/homebrew/cask?token=firefox" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/homebrew/installs

The most installed Homebrew formulae, casks or formulae installed on request, ranked, with their install counts.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `kind` | string | no | formula, cask or onRequest (formulae the user asked for, not as a dependency). (one of formula, cask, onRequest; default formula; e.g. formula) |
| `period` | string | no | Window of the counts: 30d, 90d or 365d. (one of 30d, 90d, 365d; default 30d; e.g. 30d) |
| `top` | integer | no | Number of items from the top of the ranking, 1 to 100. (default 20) |
| `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: `endDate` (string), `items` (RankedItem[]), `items[].count` (integer (int64)), `items[].name` (string), `items[].percent` (string), `items[].rank` (integer (int64)), `startDate` (string), `total` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/homebrew/installs?kind=formula&period=30d" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/homebrew/installCount

Install counts of one Homebrew formula or cask over the 30, 90 and 365 day windows, with its rank in each.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Formula or cask name, such as wget or firefox. (e.g. wget) |
| `kind` | string | no | formula, cask or onRequest (formulae the user asked for, not as a dependency). (one of formula, cask, onRequest; default formula; e.g. formula) |
| `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: `kind` (string), `name` (string), `windows` (InstallWindow[]), `windows[].count` (integer (int64)), `windows[].endDate` (string), `windows[].period` (string), `windows[].rank` (integer (int64)), `windows[].startDate` (string)

```bash
curl "https://api.hoshime.com/v1/homebrew/installCount?name=wget&kind=formula" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/homebrew/buildErrors

The Homebrew formulae whose builds failed most often, ranked, with their error counts.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `period` | string | no | Window of the counts: 30d, 90d or 365d. (one of 30d, 90d, 365d; default 30d; e.g. 30d) |
| `top` | integer | no | Number of items from the top of the ranking, 1 to 100. (default 20) |
| `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: `endDate` (string), `items` (RankedItem[]), `items[].count` (integer (int64)), `items[].name` (string), `items[].percent` (string), `items[].rank` (integer (int64)), `startDate` (string), `total` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/homebrew/buildErrors?period=30d" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
