# Grain Bin API
> Grain-bin storage maths as an API, computed locally and deterministically — the bushel and weight numbers a farmer or elevator sizes storage by. The bushels endpoint measures a round bin: floor area × grain depth gives the cubic feet, and a cubic foot holds about 0.8036 bushels, so an 18-foot bin filled 20 feet level holds roughly 4,090 bushels — and grain heaped to a peak adds a cone of (1/3) × floor area × peak height, so a 4-foot peak adds about 270 more. The weight endpoint converts bushels to weight by the crop’s standard test weight — corn and sorghum at 56 pounds a bushel, wheat and soybeans 60, oats 32, barley 48 — so those 4,090 bushels of corn weigh 229,040 pounds, about 114.5 US tons or 104 tonnes; pass a measured test weight for light or heavy grain. Everything is computed locally and deterministically, so it is instant and private. Ideal for agriculture, grain-elevator, farm-management and ag-tech app developers, storage-capacity and inventory tools, and harvest software. Pure local computation — no key, no third-party service, instant. US units (feet, bushels, pounds). Live, nothing stored. 2 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/grainbin-api/..."
```

## Pricing
- **Free** (Free) — 6,380 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 53,100 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 223,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 1,303,000 calls/Mo, 40 req/s

## Endpoints

### GrainBin

#### `GET /v1/bushels` — Bushels in a round bin

**Parameters:**
- `diameter_ft` (query, required, string) — Bin diameter (ft) Example: `18`
- `fill_height_ft` (query, required, string) — Level grain depth (ft) Example: `20`
- `peak_height_ft` (query, optional, string) — Cone peak height above level (ft) Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grainbin-api/v1/bushels?diameter_ft=18&fill_height_ft=20&peak_height_ft=0"
```

#### `GET /v1/weight` — Grain weight from bushels

**Parameters:**
- `bushels` (query, required, string) — Number of bushels Example: `4090`
- `crop` (query, optional, string) — corn, wheat, soybeans, oats, barley, … Example: `corn`
- `test_weight_lb` (query, optional, string) — Measured test weight (lb/bu)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/grainbin-api/v1/weight?bushels=4090&crop=corn"
```

### Meta

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

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


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