# Commodity Spreads API
> The spreads and ratios that commodity traders actually trade, not just the raw prices, computed live from the underlying futures — no key, nothing stored. A single commodity price means little on its own; the money is in the relationships. The crack endpoint returns the 3:2:1 crack spread — the refining margin from turning three barrels of crude oil into two of gasoline and one of heating oil, the number that drives refiner profits and gasoline prices. The crush endpoint returns the soybean crush spread — the processing margin from crushing soybeans into meal and oil. The ratios endpoint returns the classic macro ratios: gold/silver (the "fear versus growth" gauge), gold/oil (real-asset value), oil/natural-gas (the energy ratio) and gold/copper. Each comes with the component futures prices so you can see exactly how it is built. This is the commodity-spread / inter-commodity cut — distinct from the single-commodity price feed, the precious-metals spot API and the FX APIs in the catalogue. It gives you the margin and the ratio, the things that are actually positioned. All endpoints are parameter-less and return the current values with their components; the crack spread is in USD per barrel and the crush in USD per bushel.

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

## Pricing
- **Free** (Free) — 600 calls/Mo, 2 req/s
- **Starter** ($10/Mo) — 15,800 calls/Mo, 6 req/s
- **Pro** ($32/Mo) — 84,000 calls/Mo, 16 req/s
- **Business** ($75/Mo) — 440,000 calls/Mo, 40 req/s

## Endpoints

### Spreads

#### `GET /v1/crack` — 3:2:1 crack spread (refining margin)

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

**Response:**
```json
{
    "data": {
        "note": "The 3:2:1 crack spread is the refining margin from 3 barrels of crude into 2 of gasoline and 1 of heating oil, in USD per barrel. RB & HO futures (per gallon) are converted at 42 gallons per barrel. A wide crack means refiners are profitable and gasoline is dear relative to crude.",
        "source": "Yahoo Finance (CL=F, RB=F, HO=F)",
        "spread": "3:2:1 crack spread",
        "components": {
            "crude_usd_bbl": 84.52,
            "gasoline_usd_bbl": 123.52,
            "gasoline_usd_gal": 2.941,
            "heating_oil_usd_bbl": 139.86,
            "heating_oil_usd_gal": 3.3299
        },
        "value_usd_per_barrel": 44.45
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:29.235Z",
        "request_id": "4e247d71-eb20-4652-b5a9-e75fc478079b"
    },
    "status": "ok",
    "message": "Crack spread retrieved successfully",
    "success": true
}
```

#### `GET /v1/crush` — Soybean crush spread (processing margin)

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

**Response:**
```json
{
    "data": {
        "note": "The board crush is the processing margin from crushing one bushel of soybeans into meal (0.022 short tons) and oil (11 lb), in USD per bushel: meal value + oil value − soybean cost. A wide crush means processors are profitable.",
        "source": "Yahoo Finance (ZS=F, ZM=F, ZL=F)",
        "spread": "soybean crush spread (board crush)",
        "components": {
            "soybeans_usd_bu": 11.133,
            "oil_value_usd_bu": 8.037,
            "meal_value_usd_bu": 6.69,
            "soybean_oil_usc_lb": 73.06,
            "soybean_meal_usd_ton": 304.1
        },
        "value_usd_per_bushel": 3.594
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:29.425Z",
        "request_id": "10e80f58-4212-4e1b-a182-0940a9950737"
    },
    "status": "ok",
    "message": "Crush spread retrieved successfully",
    "success": true
}
```

#### `GET /v1/ratios` — Gold/silver, gold/oil, oil/natgas ratios

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

**Response:**
```json
{
    "data": {
        "note": "gold_silver is ounces of silver per ounce of gold (a high ratio = fear / silver cheap); gold_oil is barrels of crude per ounce of gold; oil_natgas is the energy ratio. Classic inter-commodity relationships traders watch.",
        "ratios": {
            "gold_oil": 50.1,
            "oil_natgas": 27.7,
            "gold_copper": 661.5,
            "gold_silver": 63.1
        },
        "source": "Yahoo Finance (GC=F, SI=F, CL=F, NG=F, HG=F)",
        "components": {
            "gold_usd_oz": 4231.8,
            "copper_usd_lb": 6.397,
            "crude_usd_bbl": 84.52,
            "silver_usd_oz": 67.04,
            "natgas_usd_mmbtu": 3.054
        }
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:29.670Z",
        "request_id": "38ddc95e-7b09-49e2-97ae-dced3a9dbfb0"
    },
    "status": "ok",
    "message": "Ratios retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "All endpoints take no parameters; they return the current spread/ratio with its components. Crack is USD/barrel, crush USD/bushel. Read fresh per call, nothing cached.",
        "source": "Yahoo Finance futures (CL=F, RB=F, HO=F, NG=F, ZS=F, ZM=F, ZL=F, GC=F, SI=F, HG=F), live",
        "service": "commodityspreads-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/crack": "The 3:2:1 crack spread (refining margin) with components.",
            "GET /v1/crush": "The soybean crush spread (processing margin) with components.",
            "GET /v1/ratios": "Gold/silver, gold/oil, oil/natgas and gold/copper ratios with components."
        },
        "description": "Commodity spreads and ratios — the relationships commodity traders actually position, computed live from the underlying futures (no key, nothing stored). crack returns the 3:2:1 crack spread (refining margin). crush returns the soybean crush spread (processing margin). ratios returns gold/silver, gold/oil, oil/natural-gas and gold/copper. Each comes with the component prices. The commodity-spread / inter-commodity cut — distinct from the single-commodity price feed, the precious-metals spot API and the FX APIs.",
        "upstream_status": "ok",
        "crack_3_2_1_usd_bbl": 44.45
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:29.785Z",
        "request_id": "0b5fede1-3af6-4604-bebe-e50bb2de63f5"
    },
    "status": "ok",
…(truncated, see openapi.json for full schema)
```


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