# Homebrew Install Analytics API
> Live install analytics for Homebrew, the macOS and Linux package manager, from the public formulae.brew.sh feed — no key, nothing stored. The adoption view of the Homebrew ecosystem: how much each command-line formula and each desktop-app cask is installed, and the most-installed packages overall, distinct from the Homebrew formula-catalog API in the catalogue (which describes a package — this measures how much it is actually used). The formula endpoint returns a command-line tool's install counts over 30, 90 and 365 days plus install-on-request, with its version and description. The cask endpoint returns a desktop app's install counts. The top endpoint returns the most-installed formulae or casks over a chosen window, ranked. Build developer-tool popularity dashboards, "is this tool still maintained and used" widgets, package-trend trackers and ecosystem-health tools on top of real Homebrew analytics. Look up a formula by its name (wget, node, ffmpeg) or a cask by its token (google-chrome, visual-studio-code); counts come from Homebrew's opted-in user analytics.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/brewanalytics-api/..."
```

## Pricing
- **Free** (Free) — 23,000 calls/Mo, 3 req/s
- **Starter** ($5/Mo) — 310,000 calls/Mo, 10 req/s
- **Pro** ($15/Mo) — 1,300,000 calls/Mo, 25 req/s
- **Scale** ($34/Mo) — 4,600,000 calls/Mo, 55 req/s

## Endpoints

### Formula

#### `GET /v1/formula` — Install counts for a command-line formula

**Parameters:**
- `name` (query, required, string) — Formula name Example: `wget`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/brewanalytics-api/v1/formula?name=wget"
```

**Response:**
```json
{
    "data": {
        "name": "wget",
        "type": "formula",
        "source": "Homebrew",
        "version": "1.25.0",
        "homepage": "https://www.gnu.org/software/wget/",
        "deprecated": false,
        "description": "Internet file retriever",
        "installs_30d": 22610,
        "installs_90d": 74752,
        "installs_365d": 384754,
        "install_on_request_365d": 380950
    },
    "meta": {
        "timestamp": "2026-06-12T01:42:22.379Z",
        "request_id": "c0a94f39-3792-42ae-8136-5030db0f2431"
    },
    "status": "ok",
    "message": "Formula retrieved successfully",
    "success": true
}
```

### Cask

#### `GET /v1/cask` — Install counts for a desktop-app cask

**Parameters:**
- `name` (query, required, string) — Cask token Example: `google-chrome`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/brewanalytics-api/v1/cask?name=google-chrome"
```

**Response:**
```json
{
    "data": {
        "name": "Google Chrome",
        "type": "cask",
        "token": "google-chrome",
        "source": "Homebrew",
        "version": "149.0.7827.103",
        "homepage": "https://www.google.com/chrome/",
        "deprecated": false,
        "description": "Web browser",
        "installs_30d": 46494,
        "installs_90d": 128293,
        "installs_365d": 395768
    },
    "meta": {
        "timestamp": "2026-06-12T01:42:22.504Z",
        "request_id": "0aebbb35-629f-4235-ae1a-584700252cb6"
    },
    "status": "ok",
    "message": "Cask retrieved successfully",
    "success": true
}
```

### Top

#### `GET /v1/top` — Most-installed packages

**Parameters:**
- `type` (query, optional, string) — formula or cask (default formula) Example: `formula`
- `days` (query, optional, string) — 30, 90 or 365 (default 30) Example: `30`
- `limit` (query, optional, string) — Max rows (default 25, max 100) Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/brewanalytics-api/v1/top?type=formula&days=30&limit=25"
```

**Response:**
```json
{
    "data": {
        "top": [
            {
                "name": "ca-certificates",
                "rank": 1,
                "installs": 543337
            },
            {
                "name": "openssl@3",
                "rank": 2,
                "installs": 433265
            },
            {
                "name": "sqlite",
                "rank": 3,
                "installs": 388182
            },
            {
                "name": "xz",
                "rank": 4,
                "installs": 324983
            },
            {
                "name": "python@3.14",
                "rank": 5,
                "installs": 314259
            },
            {
                "name": "gh",
                "rank": 6,
                "installs": 263409
            },
            {
                "name": "zstd",
                "rank": 7,
                "installs": 251248
            },
            {
                "name": "node",
                "rank": 8,
                "installs": 228308
            },
            {
                "name": "readline",
                "rank": 9,
                "installs": 211838
            },
            {
                "name": "awscli",
                "rank": 10,
                "installs": 199735
            },
            {
                "name": "fontconfig",
                "rank": 11,
                "installs": 196368
            },
            {
                "name": "lz4",
                "rank": 12,
      
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/brewanalytics-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Look up a formula by name (wget, node, ffmpeg) or a cask by token (google-chrome, visual-studio-code). For /v1/top, type=formula|cask and days=30|90|365. Counts come from Homebrew's opted-in analytics.",
        "source": "formulae.brew.sh public API (live)",
        "service": "brewanalytics-api",
        "endpoints": {
            "GET /v1/top": "Most-installed packages (type=formula|cask, days=30|90|365, limit=25).",
            "GET /v1/cask": "Install counts for a desktop-app cask (name=google-chrome).",
            "GET /v1/meta": "This document.",
            "GET /v1/formula": "Install counts for a command-line formula (name=wget)."
        },
        "description": "Live install analytics for Homebrew, the macOS/Linux package manager, from formulae.brew.sh — the adoption view of the Homebrew ecosystem. formula = a command-line tool's install counts (30, 90 and 365 days, plus install-on-request) with version and description; cask = a desktop app's install counts; top = the most-installed formulae or casks over a window. Live, no key, nothing stored. Distinct from the Homebrew formula-catalog API — this measures how much a package is actually used.",
        "upstream_status": "ok",
        "wget_installs_365d": 384754
    },
    "meta": {
        "timestamp": "2026-06-12T01:42:22.864Z",
        "request_id": "e4a001de-7035-4cbd-9445-1d0b6d3e6069"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/brewanalytics-api
OpenAPI spec: https://www.oanor.com/api/brewanalytics-api/openapi.json
