# Fruit Nutrition API
> Fruit nutrition and botanical taxonomy as an API, built on the open Fruityvice dataset. Get every fruit with its scientific classification — family, genus and order — and its per-100g nutrition: calories, sugar, carbohydrates, protein and fat. Look up a single fruit by name, list every fruit in a botanical family (e.g. Rosaceae), genus (e.g. Prunus) or order (e.g. Rosales), or filter the whole catalogue by a nutrient range — for example all fruits with under 5g of sugar, sorted lowest first. Real data, no key needed upstream. Ideal for nutrition and diet apps, smoothie and recipe tools, health trackers and educational projects.

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

## Pricing
- **Free** (Free) — 14,000 calls/Mo, 2 req/s
- **Starter** ($2/Mo) — 170,000 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 800,000 calls/Mo, 25 req/s
- **Mega** ($49/Mo) — 3,700,000 calls/Mo, 50 req/s

## Endpoints

### Fruit

#### `GET /v1/all` — Every fruit with nutrition

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

**Response:**
```json
{
    "data": {
        "count": 49,
        "fruits": [
            {
                "id": 52,
                "name": "Persimmon",
                "genus": "Diospyros",
                "order": "Rosales",
                "family": "Ebenaceae",
                "nutritions": {
                    "fat": 0,
                    "sugar": 18,
                    "protein": 0,
                    "calories": 81,
                    "carbohydrates": 18
                }
            },
            {
                "id": 3,
                "name": "Strawberry",
                "genus": "Fragaria",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.4,
                    "sugar": 5.4,
                    "protein": 0.8,
                    "calories": 29,
                    "carbohydrates": 5.5
                }
            },
            {
                "id": 1,
                "name": "Banana",
                "genus": "Musa",
                "order": "Zingiberales",
                "family": "Musaceae",
                "nutritions": {
                    "fat": 0.2,
                    "sugar": 17.2,
                    "protein": 1,
                    "calories": 96,
                    "carbohydrates": 22
                }
            },
            {
                "id": 5,
                "name": "Tomato",
                "genus": "Solanum",
                "order": "Solanales",
         
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/family` — Fruits in a botanical family

**Parameters:**
- `family` (query, required, string) — Family, e.g. Rosaceae Example: `Rosaceae`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fruit-api/v1/family?family=Rosaceae"
```

**Response:**
```json
{
    "data": {
        "count": 11,
        "family": "Rosaceae",
        "fruits": [
            {
                "id": 3,
                "name": "Strawberry",
                "genus": "Fragaria",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.4,
                    "sugar": 5.4,
                    "protein": 0.8,
                    "calories": 29,
                    "carbohydrates": 5.5
                }
            },
            {
                "id": 4,
                "name": "Pear",
                "genus": "Pyrus",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.1,
                    "sugar": 10,
                    "protein": 0.4,
                    "calories": 57,
                    "carbohydrates": 15
                }
            },
            {
                "id": 64,
                "name": "Blackberry",
                "genus": "Rubus",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.4,
                    "sugar": 4.5,
                    "protein": 1.3,
                    "calories": 40,
                    "carbohydrates": 9
                }
            },
            {
                "id": 71,
                "name": "Plum",
                "genus": "Prunus",
                "order": 
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/filter` — Filter by a nutrient range

**Parameters:**
- `nutrient` (query, required, string) — calories | sugar | carbohydrates | protein | fat Example: `sugar`
- `min` (query, optional, string) — Minimum value Example: `0`
- `max` (query, optional, string) — Maximum value Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fruit-api/v1/filter?nutrient=sugar&min=0&max=5"
```

**Response:**
```json
{
    "data": {
        "max": 5,
        "min": 0,
        "count": 16,
        "fruits": [
            {
                "id": 69,
                "name": "Gooseberry",
                "genus": "Ribes",
                "order": "Saxifragales",
                "family": "Grossulariaceae",
                "nutritions": {
                    "fat": 0.6,
                    "sugar": 0,
                    "protein": 0.9,
                    "calories": 44,
                    "carbohydrates": 10
                }
            },
            {
                "id": 95,
                "name": "Horned Melon",
                "genus": "Cucumis",
                "order": "Cucurbitales",
                "family": "Cucurbitaceae",
                "nutritions": {
                    "fat": 1.26,
                    "sugar": 0.5,
                    "protein": 1.78,
                    "calories": 44,
                    "carbohydrates": 7.56
                }
            },
            {
                "id": 84,
                "name": "Avocado",
                "genus": "Persea",
                "order": "Laurales",
                "family": "Lauraceae",
                "nutritions": {
                    "fat": 14.66,
                    "sugar": 0.66,
                    "protein": 2,
                    "calories": 160,
                    "carbohydrates": 8.53
                }
            },
            {
                "id": 44,
                "name": "Lime",
                
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/fruit` — A single fruit by name

**Parameters:**
- `name` (query, required, string) — Fruit name, e.g. banana Example: `banana`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fruit-api/v1/fruit?name=banana"
```

**Response:**
```json
{
    "data": {
        "fruit": {
            "id": 1,
            "name": "Banana",
            "genus": "Musa",
            "order": "Zingiberales",
            "family": "Musaceae",
            "nutritions": {
                "fat": 0.2,
                "sugar": 17.2,
                "protein": 1,
                "calories": 96,
                "carbohydrates": 22
            }
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:02.035Z",
        "request_id": "72477617-7fa9-4c5a-8123-d5a43c18c99d"
    },
    "status": "ok",
    "message": "Fruit retrieved successfully",
    "success": true
}
```

#### `GET /v1/genus` — Fruits in a genus

**Parameters:**
- `genus` (query, required, string) — Genus, e.g. Prunus Example: `Prunus`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fruit-api/v1/genus?genus=Prunus"
```

**Response:**
```json
{
    "data": {
        "count": 4,
        "genus": "Prunus",
        "fruits": [
            {
                "id": 71,
                "name": "Plum",
                "genus": "Prunus",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.28,
                    "sugar": 9.92,
                    "protein": 0.7,
                    "calories": 46,
                    "carbohydrates": 11.4
                }
            },
            {
                "id": 35,
                "name": "Apricot",
                "genus": "Prunus",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.1,
                    "sugar": 3.2,
                    "protein": 0.5,
                    "calories": 15,
                    "carbohydrates": 3.9
                }
            },
            {
                "id": 9,
                "name": "Cherry",
                "genus": "Prunus",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.3,
                    "sugar": 8,
                    "protein": 1,
                    "calories": 50,
                    "carbohydrates": 12
                }
            },
            {
                "id": 86,
                "name": "Peach",
                "genus": "Prunus",
                "order": "Rosale
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/order` — Fruits in an order

**Parameters:**
- `order` (query, required, string) — Order, e.g. Rosales Example: `Rosales`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fruit-api/v1/order?order=Rosales"
```

**Response:**
```json
{
    "data": {
        "count": 16,
        "order": "Rosales",
        "fruits": [
            {
                "id": 52,
                "name": "Persimmon",
                "genus": "Diospyros",
                "order": "Rosales",
                "family": "Ebenaceae",
                "nutritions": {
                    "fat": 0,
                    "sugar": 18,
                    "protein": 0,
                    "calories": 81,
                    "carbohydrates": 18
                }
            },
            {
                "id": 3,
                "name": "Strawberry",
                "genus": "Fragaria",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.4,
                    "sugar": 5.4,
                    "protein": 0.8,
                    "calories": 29,
                    "carbohydrates": 5.5
                }
            },
            {
                "id": 4,
                "name": "Pear",
                "genus": "Pyrus",
                "order": "Rosales",
                "family": "Rosaceae",
                "nutritions": {
                    "fat": 0.1,
                    "sugar": 10,
                    "protein": 0.4,
                    "calories": 57,
                    "carbohydrates": 15
                }
            },
            {
                "id": 64,
                "name": "Blackberry",
                "genus": "Rubus",
                "order
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service description & endpoints

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

**Response:**
```json
{
    "data": {
        "service": "fruit-api",
        "endpoints": {
            "GET /v1/all": "Every fruit with nutrition.",
            "GET /v1/meta": "This document.",
            "GET /v1/fruit": "A single fruit by name (name=, e.g. banana).",
            "GET /v1/genus": "Fruits in a genus (genus=, e.g. Prunus).",
            "GET /v1/order": "Fruits in an order (order=, e.g. Rosales).",
            "GET /v1/family": "Fruits in a botanical family (family=, e.g. Rosaceae).",
            "GET /v1/filter": "Filter by a nutrient range (nutrient=sugar, min=, max=)."
        },
        "nutrients": [
            "calories",
            "sugar",
            "carbohydrates",
            "protein",
            "fat"
        ],
        "description": "Fruit nutrition & taxonomy via Fruityvice: every fruit with its botanical family, genus and order plus per-100g nutrition (calories, sugar, carbohydrates, protein, fat). Look up a fruit by name, list a whole family/genus/order, or filter the catalogue by a nutrient range. Real data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:02.372Z",
        "request_id": "1c964017-2ccd-4c83-aea0-c375dcd79ad0"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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