# Breweries API
> Search, filter and locate breweries worldwide — a fast, clean wrapper over Open Brewery DB covering thousands of breweries across the US and beyond. Filter by city, state, country, name, postal code or brewery type (micro, nano, regional, brewpub, large, bar, contract and more), sort results nearest-first from any latitude/longitude, autocomplete brewery names for typeahead, pull random breweries, fetch a single brewery by id and read aggregate counts. Every endpoint accepts input via the query string or the request body and returns lean, predictable JSON with normalized address, coordinates, phone and website fields. Ideal for beer and travel apps, store locators, maps and directory features.

## 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/beer-api/..."
```

## Pricing
- **Free** (Free) — 12,000 calls/Mo, 3 req/s
- **Basic** ($4/Mo) — 120,000 calls/Mo, 8 req/s
- **Pro** ($12/Mo) — 800,000 calls/Mo, 20 req/s
- **Mega** ($35/Mo) — 4,000,000 calls/Mo, 50 req/s

## Endpoints

### Breweries

#### `GET /v1/autocomplete` — Autocomplete brewery names

**Parameters:**
- `query` (query, required, string) — Partial name Example: `dog`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beer-api/v1/autocomplete?query=dog"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "query": "dog",
        "results": [
            {
                "id": "78c50e54-34e3-415d-9574-ac0cc0505113",
                "name": "Dog & Pony Alehouse and Grill"
            },
            {
                "id": "b29882fe-e037-4e4a-a164-eb76723893ac",
                "name": "Dog and Pony Brewing Company"
            },
            {
                "id": "c27f55b4-f410-4389-ae35-a5a9bada3578",
                "name": "Dog Days Brewing"
            },
            {
                "id": "e4054c02-8992-4c0c-8954-89f0d6ebaead",
                "name": "Dog Tag Brewing"
            },
            {
                "id": "e7663a51-2d14-4e31-b52b-a3cd846fd19a",
                "name": "Dog Money Restaurant"
            },
            {
                "id": "fe4c36a3-d900-46b0-b445-a4f951b9f7e2",
                "name": "Dog Rose Brewing Company"
            },
            {
                "id": "281e6980-e2e2-4493-9896-3517e8cafe21",
                "name": "Dogfish Head Craft Brewery"
            },
            {
                "id": "7a6bd1cf-4385-4677-a9d7-3507535399e4",
                "name": "Dogfish Head Brewings & Eats"
            },
            {
                "id": "9144058f-df13-47b0-b656-4c4384058085",
                "name": "DogBerry Brewing LLC"
            },
            {
                "id": "b391b3db-33bf-47d4-8878-ab3f8b610bde",
                "name": "Dogtown Brewing"
            },
            {
   
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/brewery` — Single brewery by id

**Parameters:**
- `id` (query, required, string) — Brewery UUID Example: `5128df48-79fc-4f0f-8b52-d06be54d0cec`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beer-api/v1/brewery?id=5128df48-79fc-4f0f-8b52-d06be54d0cec"
```

**Response:**
```json
{
    "data": {
        "id": "5128df48-79fc-4f0f-8b52-d06be54d0cec",
        "city": "Norman",
        "name": "(405) Brewing Co",
        "type": "micro",
        "phone": "4058160490",
        "state": "Oklahoma",
        "street": "1716 Topeka St",
        "country": "United States",
        "latitude": 35.25738891,
        "longitude": -97.46818222,
        "postal_code": "73069-8224",
        "website_url": "http://www.405brewing.com"
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:43.600Z",
        "request_id": "72f4ab8c-9ae2-4482-8dff-92325f73fee8"
    },
    "status": "ok",
    "message": "Brewery retrieved",
    "success": true
}
```

#### `GET /v1/meta` — Aggregate counts

**Parameters:**
- `by_country` (query, optional, string) — Country Example: `united states`
- `by_state` (query, optional, string) — State Example: `california`
- `by_type` (query, optional, string) — Type Example: `micro`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beer-api/v1/meta?by_country=united+states&by_state=california&by_type=micro"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "total": 466,
        "per_page": 50
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:44.243Z",
        "request_id": "91e24b78-ce22-4e0c-a658-73dc7309818b"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```

#### `GET /v1/random` — Random breweries

**Parameters:**
- `size` (query, optional, string) — 1..10 (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beer-api/v1/random?size=1"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "results": [
            {
                "id": "8df1dd63-af4f-4173-805a-3c1c22a4df2d",
                "city": "Destin",
                "name": "McGuire's Irish Pub and Brewery - Destin",
                "type": "brewpub",
                "phone": "8506540567",
                "state": "Florida",
                "street": "33 Highway 98 E",
                "country": "United States",
                "latitude": null,
                "longitude": null,
                "postal_code": "32541-2309",
                "website_url": "http://www.mcguiresirishpub.com"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:44.786Z",
        "request_id": "d3795284-d9d9-41ee-bb9e-ca3a6fa0b114"
    },
    "status": "ok",
    "message": "Random brewery retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search & filter breweries

**Parameters:**
- `by_city` (query, optional, string) — City Example: `san diego`
- `by_state` (query, optional, string) — State/province Example: `california`
- `by_country` (query, optional, string) — Country Example: `united states`
- `by_type` (query, optional, string) — micro|nano|regional|brewpub|large|bar|contract|... Example: `micro`
- `by_name` (query, optional, string) — Name contains Example: `dog`
- `lat` (query, optional, string) — Latitude for nearest-first Example: `32.71`
- `lon` (query, optional, string) — Longitude for nearest-first Example: `-117.16`
- `per_page` (query, optional, string) — 1..50 (default 15) Example: `15`
- `page` (query, optional, string) — Page Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beer-api/v1/search?by_city=san+diego&by_state=california&by_country=united+states&by_type=micro&by_name=dog&lat=32.71&lon=-117.16&per_page=15&page=1"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "count": 0,
        "filters": {
            "by_city": "san_diego",
            "by_dist": "32.71,-117.16",
            "by_name": "dog",
            "by_type": "micro",
            "by_state": "california",
            "by_country": "united_states"
        },
        "results": [],
        "per_page": 15
    },
    "meta": {
        "timestamp": "2026-05-30T22:48:45.372Z",
        "request_id": "6bd186a2-a353-4097-ad7f-a802575bf7ac"
    },
    "status": "ok",
    "message": "Search completed",
    "success": true
}
```


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