# Pet Food & Calorie API
> Pet-nutrition maths as an API, computed locally and deterministically — the calorie, portion and water numbers a dog or cat owner, breeder or pet app feeds an animal by. The calories endpoint uses the standard veterinary formula: resting energy RER = 70 × (body weight in kg)^0.75, then daily maintenance MER = RER × a lifestage factor — 1.6 for a neutered adult dog, 1.2 for a neutered cat, 1.0 or 0.8 for weight loss, 2–3 for puppies and 2.5 for kittens — so a 10 kg neutered dog needs about 394 kcal at rest and 630 kcal a day, and a 5 kg neutered cat about 234 and 281. Weight takes kg or pounds, and a custom factor overrides the table. The portion endpoint turns that calorie need into food: daily grams = calories ÷ the food’s energy density (kcal per 100 g, often 350–450 for dry kibble) or cups ÷ kcal per cup, split across meals — so 630 kcal of a 375-kcal/100 g kibble is about 168 g a day, 84 g per meal. The water endpoint gives the daily requirement, roughly 50–60 ml per kg for dogs and 50 for cats. Everything is computed locally and deterministically, so it is instant and private. Ideal for pet-care, veterinary, pet-food, dog- and cat-app developers, feeding-calculator and pet-health tools, and breeder software. Pure local computation — no key, no third-party service, instant. Educational estimates, not veterinary advice. Live, nothing stored. 3 compute endpoints. For dog-age conversion use a different API.

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

## Pricing
- **Free** (Free) — 7,500 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 57,000 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 234,000 calls/Mo, 15 req/s
- **Mega** ($37/Mo) — 1,352,000 calls/Mo, 40 req/s

## Endpoints

### PetFood

#### `GET /v1/calories` — Daily caloric needs (RER/MER)

**Parameters:**
- `species` (query, required, string) — dog or cat Example: `dog`
- `weight` (query, required, string) — Body weight Example: `10`
- `unit` (query, optional, string) — kg or lb (default kg) Example: `kg`
- `lifestage` (query, optional, string) — neutered, intact, weight_loss, puppy_young, kitten, … Example: `neutered`
- `factor` (query, optional, string) — Custom MER factor (overrides lifestage)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/petfood-api/v1/calories?species=dog&weight=10&unit=kg&lifestage=neutered"
```

**Response:**
```json
{
    "data": {
        "note": "RER (resting) = 70 × (kg)^0.75. MER (maintenance, daily need) = RER × a lifestage factor — neutered adult dog 1.6, cat 1.2; weight loss 1.0/0.8; puppy 2–3, kitten 2.5. Pass a custom factor to override. A guide, not a substitute for your vet.",
        "inputs": {
            "unit": "kg",
            "factor": 1.6,
            "weight": 10,
            "species": "dog",
            "lifestage": "neutered",
            "weight_kg": 10
        },
        "mer_kcal": 629.8,
        "rer_kcal": 393.6,
        "mer_factor": 1.6
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.705Z",
        "request_id": "0bc88731-c04f-4c4d-b910-0de899239d08"
    },
    "status": "ok",
    "message": "Caloric needs",
    "success": true
}
```

#### `GET /v1/portion` — Daily food portion

**Parameters:**
- `daily_kcal` (query, required, string) — Daily calorie need (MER) Example: `630`
- `kcal_per_100g` (query, optional, string) — Food energy density per 100 g Example: `375`
- `kcal_per_cup` (query, optional, string) — Food energy density per cup Example: `350`
- `meals_per_day` (query, optional, string) — Meals per day (default 2) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/petfood-api/v1/portion?daily_kcal=630&kcal_per_100g=375&kcal_per_cup=350&meals_per_day=2"
```

**Response:**
```json
{
    "data": {
        "note": "Daily food = calorie need ÷ the food's energy density. Dry kibble is often 350–450 kcal per 100 g (~350–450 kcal/cup); wet food far less. Split across meals. Check the bag's stated kcal/kg or kcal/cup.",
        "inputs": {
            "daily_kcal": 630,
            "meals_per_day": 2
        },
        "daily_kcal": 630,
        "cups_per_day": 1.8,
        "kcal_per_cup": 350,
        "cups_per_meal": 0.9,
        "grams_per_day": 168,
        "kcal_per_100g": 375,
        "grams_per_meal": 84
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.807Z",
        "request_id": "af5e558d-fb60-4ecc-ba91-826be72bff2f"
    },
    "status": "ok",
    "message": "Food portion",
    "success": true
}
```

#### `GET /v1/water` — Daily water requirement

**Parameters:**
- `species` (query, required, string) — dog or cat Example: `dog`
- `weight` (query, required, string) — Body weight Example: `10`
- `unit` (query, optional, string) — kg or lb Example: `kg`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/petfood-api/v1/water?species=dog&weight=10&unit=kg"
```

**Response:**
```json
{
    "data": {
        "note": "Roughly 50–60 ml per kg per day for dogs, ~50 ml/kg for cats, including water from food. More in heat or with activity; wet-food diets supply much of it. Sudden big changes in drinking warrant a vet visit.",
        "inputs": {
            "unit": "kg",
            "weight": 10,
            "species": "dog",
            "weight_kg": 10
        },
        "water_ml_per_day": 550,
        "water_cups_per_day": 2.32
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.882Z",
        "request_id": "79e3fc02-ec44-49ce-8539-37b85aade102"
    },
    "status": "ok",
    "message": "Water needs",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "RER = 70 × kg^0.75; MER = RER × lifestage factor. Weight in kg or lb. Energy density from the food label (kcal/100g or kcal/cup). Educational estimates — consult a veterinarian for medical or weight plans.",
        "service": "petfood-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/water": "Daily water requirement for a dog or cat.",
            "GET /v1/portion": "Daily and per-meal food amount from the calorie need and the food's kcal density.",
            "GET /v1/calories": "Resting (RER) and maintenance (MER) daily calories by species, weight and lifestage."
        },
        "description": "Pet-nutrition maths: daily caloric needs (RER/MER), food portion from energy density, and water requirement for dogs and cats."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.969Z",
        "request_id": "e32add6a-af3a-4a38-a5c8-86c108447bd9"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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