# Rotational Grazing API
> Rotational-grazing maths as an API, computed locally and deterministically — the animal-unit, grazing-day and acreage numbers a rancher or homesteader moves a herd by. It all hangs on the animal unit: a 1000-pound cow eating about 26 pounds of dry matter a day. The animalunits endpoint converts a mixed herd to that common basis — a cow is 1.0 AU, a cow-calf pair 1.3, a horse 1.25, a sheep 0.2, a goat 0.17 — so ten cows and fifty sheep are 20 AU demanding 520 pounds of forage a day; pass a weight instead and it scales by weight ÷ 1000. The days endpoint works out how long a paddock lasts: grazing days = (acres × forage per acre × utilization) ÷ (animal units × 26), where the classic “take half, leave half” puts utilization near 50 %, so five acres yielding 3,000 lb at 50 % feeds 10 AU for about 29 days. The acres endpoint sizes the paddock the other way — acres = (AU × 26 × days) ÷ (forage × utilization) — so 20 AU for a 30-day move needs about 10.4 acres. Everything is computed locally and deterministically, so it is instant and private. Ideal for ranching, regenerative-agriculture, homesteading and farm-management app developers, paddock-planner and stocking-rate tools, and grazing-chart software. Pure local computation — no key, no third-party service, instant. US units; forage yield varies with season — measure it. Live, nothing stored. 3 compute endpoints.

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

## Pricing
- **Free** (Free) — 6,440 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 53,600 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 224,200 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 1,308,000 calls/Mo, 40 req/s

## Endpoints

### Grazing

#### `GET /v1/acres` — Acreage for a herd & period

**Parameters:**
- `animal_units` (query, required, string) — Herd animal units Example: `20`
- `days` (query, required, string) — Grazing days Example: `30`
- `forage_lb_per_acre` (query, required, string) — Standing forage (lb DM/acre) Example: `3000`
- `utilization_percent` (query, optional, string) — Utilization % (default 50) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grazing-api/v1/acres?animal_units=20&days=30&forage_lb_per_acre=3000&utilization_percent=50"
```

#### `GET /v1/animalunits` — Herd → animal units

**Parameters:**
- `herd` (query, optional, string) — Comma list 'type:count' (cow, sheep, goat, horse, …) Example: `cow:10,sheep:50`
- `weight_lb` (query, optional, string) — Animal weight (lb) instead of a herd
- `count` (query, optional, string) — Number of animals (with weight_lb) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grazing-api/v1/animalunits?herd=cow%3A10%2Csheep%3A50&count=1"
```

#### `GET /v1/days` — Grazing days for a paddock

**Parameters:**
- `acres` (query, required, string) — Paddock size (acres) Example: `5`
- `forage_lb_per_acre` (query, required, string) — Standing forage (lb DM/acre) Example: `3000`
- `animal_units` (query, required, string) — Herd animal units Example: `10`
- `utilization_percent` (query, optional, string) — Utilization % (default 50) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grazing-api/v1/days?acres=5&forage_lb_per_acre=3000&animal_units=10&utilization_percent=50"
```

### Meta

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

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


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