# Beekeeping API
> Beekeeping and apiary maths as an API, computed locally and deterministically — the mite, brood and winter-stores numbers a beekeeper manages a hive with. The varroa endpoint turns an alcohol-wash or sugar-shake count into the infestation rate: mites per 100 bees = mite count ÷ bees sampled × 100, where a half-cup scoop is about 300 bees, and it flags when the colony crosses the treatment threshold (commonly 3 mites per 100 bees, or 3 %). The brood endpoint projects the development calendar from the day an egg is laid: it hatches around day 3, the cell is capped around day 8–10 and the adult emerges on day 16 for a queen, 21 for a worker and 24 for a drone — so a worker egg laid on the 1st emerges three weeks later. The stores endpoint sizes winter honey: how many kilograms the colony needs by climate (about 12 kg mild to 35 kg harsh), the equivalent full deep frames (~2.25 kg each), and the deficit and frames to feed against the current stores. Date arithmetic is exact. Everything is computed locally and deterministically, so it is instant and private. Ideal for beekeeping, apiary-management, homestead and agriculture app developers, hive-inspection and mite-monitoring tools, and beekeeping education. Pure local computation — no key, no third-party service, instant. Dates as YYYY-MM-DD; metric weights. Live, nothing stored. 3 compute endpoints. A planning aid — local conditions vary.

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

## Pricing
- **Free** (Free) — 7,150 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 67,000 calls/Mo, 6 req/s
- **Pro** ($8/Mo) — 262,000 calls/Mo, 15 req/s
- **Mega** ($26/Mo) — 1,490,000 calls/Mo, 40 req/s

## Endpoints

### Apiary

#### `GET /v1/brood` — Brood development dates

**Parameters:**
- `caste` (query, optional, string) — queen, worker or drone Example: `worker`
- `lay_date` (query, required, string) — Egg-lay date YYYY-MM-DD Example: `2026-05-01`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/apiary-api/v1/brood?caste=worker&lay_date=2026-05-01"
```

**Response:**
```json
{
    "data": {
        "note": "From the day the egg is laid: it hatches around day 3, the cell is capped around day 8–10, and the adult emerges on day 16 (queen), 21 (worker) or 24 (drone).",
        "inputs": {
            "caste": "worker",
            "lay_date": "2026-05-01"
        },
        "hatch_date": "2026-05-04",
        "capped_date": "2026-05-10",
        "emergence_date": "2026-05-22",
        "emergence_days": 21
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:10.675Z",
        "request_id": "c3bd7dcb-8a58-434b-99b3-741c1f1823ab"
    },
    "status": "ok",
    "message": "Brood cycle",
    "success": true
}
```

#### `GET /v1/stores` — Winter honey stores

**Parameters:**
- `climate` (query, optional, string) — mild, temperate, cold, harsh Example: `cold`
- `honey_needed_kg` (query, optional, string) — Or target honey kg
- `honey_per_frame_kg` (query, optional, string) — Honey per deep frame kg (default 2.25)
- `current_stores_kg` (query, optional, string) — Current stores kg

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/apiary-api/v1/stores?climate=cold"
```

**Response:**
```json
{
    "data": {
        "note": "Winter stores depend on climate (~12 kg mild to ~35 kg harsh). A full deep frame holds ~2.25 kg of honey. Feed to close the deficit before it gets cold.",
        "inputs": {
            "climate": "cold",
            "honey_needed_kg": 27,
            "current_stores_kg": 0
        },
        "deficit_kg": 27,
        "frames_to_add": 12,
        "frames_of_honey": 12,
        "honey_needed_kg": 27
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:10.763Z",
        "request_id": "4025d84c-2d62-4879-bbd8-534ec29e7792"
    },
    "status": "ok",
    "message": "Winter stores",
    "success": true
}
```

#### `GET /v1/varroa` — Varroa infestation %

**Parameters:**
- `mite_count` (query, required, string) — Mites counted Example: `9`
- `bees_sampled` (query, optional, string) — Bees in sample (default 300) Example: `300`
- `threshold_percent` (query, optional, string) — Treatment threshold % (default 3)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/apiary-api/v1/varroa?mite_count=9&bees_sampled=300"
```

**Response:**
```json
{
    "data": {
        "note": "Infestation % = mites ÷ bees sampled × 100. A half-cup scoop is ~300 bees. Most programs treat at ~3 mites per 100 bees (3%); act sooner before winter bees are reared.",
        "inputs": {
            "mite_count": 9,
            "bees_sampled": 300
        },
        "threshold_percent": 3,
        "mites_per_100_bees": 3,
        "infestation_percent": 3,
        "treatment_recommended": true,
        "estimated_mites_per_1000": 30
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:10.824Z",
        "request_id": "a758560f-0f81-436c-b976-2606427c57da"
    },
    "status": "ok",
    "message": "Varroa wash",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "notes": "Dates as YYYY-MM-DD. Sample ~300 bees for a wash. Caste emergence: queen 16 d, worker 21 d, drone 24 d. A planning aid — local conditions vary.",
        "service": "apiary-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/brood": "Hatch, capping and emergence dates from the egg-lay date and caste.",
            "GET /v1/stores": "Winter honey needed and frames from climate or a target, vs current stores.",
            "GET /v1/varroa": "Infestation % and treatment threshold from a mite wash of a bee sample."
        },
        "description": "Beekeeping maths: varroa-mite infestation from a wash, brood development dates by caste, and winter honey stores."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:10.922Z",
        "request_id": "c34c7dbf-98d8-4d38-90b7-dc579f76654a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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