# Currency Index API
> Live currency-index maths that FX desks run to turn a set of exchange rates into a single index value, computed on demand from the rates you pass in — no key, no cache, nothing stored. The dxy endpoint computes the US Dollar Index (USDX) from its six component rates using the official ICE weights and formula — feed in EUR/USD, USD/JPY, GBP/USD, USD/CAD, USD/SEK and USD/CHF and get the index value the way the exchanges calculate it. The index endpoint builds an arbitrary weighted index from your own components: geometric (the standard for currency indices) or arithmetic, with a scaling constant and negative weights for inversely-quoted pairs. The basket endpoint computes a trade-weighted index normalised to 100, showing how a currency has moved against a basket from a set of reference rates — above 100 means it strengthened. This is an index-construction engine, distinct from published effective-exchange-rate feeds and strength meters: you supply the rates and weights and it returns the index, deterministically. Works for any custom basket. Computed locally, so it is instant and private. Ideal for FX dashboards, custom dollar/euro indices, back-tests and macro tools. Live, nothing stored. 3 compute endpoints. For published effective-exchange-rate data use a central-bank or BIS 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/currencyindex-api/..."
```

## Pricing
- **Free** (Free) — 4,300 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 87,000 calls/Mo, 6 req/s
- **Pro** ($24/Mo) — 455,000 calls/Mo, 18 req/s
- **Business** ($56/Mo) — 2,780,000 calls/Mo, 45 req/s

## Endpoints

### Index

#### `GET /v1/basket` — Trade-weighted index normalised to 100

**Parameters:**
- `components` (query, required, string) — current:base:weight triplets, comma-separated Example: `1.08:1.10:0.5,150:148:0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/currencyindex-api/v1/basket?components=1.08%3A1.10%3A0.5%2C150%3A148%3A0.5"
```

**Response:**
```json
{
    "data": {
        "legs": [
            {
                "base": 1.1,
                "ratio": 0.98181818,
                "weight": 0.5,
                "current": 1.08
            },
            {
                "base": 148,
                "ratio": 1.01351351,
                "weight": 0.5,
                "current": 150
            }
        ],
        "note": "Trade-weighted index normalised to 100 = 100 x product((current/base)^(weight/total_weight)). Above 100 = the indexed currency strengthened vs the basket.",
        "value": 99.754,
        "source": "CURRENCY-INDEX",
        "direction": "weaker",
        "base_value": 100,
        "change_pct": -0.246,
        "components": 2
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:21.453Z",
        "request_id": "fd9df245-7281-4a43-aaee-625d528c90ad"
    },
    "status": "ok",
    "message": "Basket index computed",
    "success": true
}
```

#### `GET /v1/dxy` — US Dollar Index from its 6 components

**Parameters:**
- `eurusd` (query, required, string) — EUR/USD rate Example: `1.08`
- `usdjpy` (query, required, string) — USD/JPY rate Example: `150`
- `gbpusd` (query, required, string) — GBP/USD rate Example: `1.27`
- `usdcad` (query, required, string) — USD/CAD rate Example: `1.37`
- `usdsek` (query, required, string) — USD/SEK rate Example: `10.5`
- `usdchf` (query, required, string) — USD/CHF rate Example: `0.91`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/currencyindex-api/v1/dxy?eurusd=1.08&usdjpy=150&gbpusd=1.27&usdcad=1.37&usdsek=10.5&usdchf=0.91"
```

**Response:**
```json
{
    "data": {
        "note": "Official ICE US Dollar Index = 50.14348112 x EURUSD^-0.576 x USDJPY^0.136 x GBPUSD^-0.119 x USDCAD^0.091 x USDSEK^0.042 x USDCHF^0.036. Negative exponents are pairs quoted as XXX/USD.",
        "index": "USDX",
        "value": 104.3314,
        "source": "CURRENCY-INDEX",
        "constant": 50.14348112,
        "components": [
            {
                "pair": "EUR/USD",
                "rate": 1.08,
                "exponent": -0.576
            },
            {
                "pair": "USD/JPY",
                "rate": 150,
                "exponent": 0.136
            },
            {
                "pair": "GBP/USD",
                "rate": 1.27,
                "exponent": -0.119
            },
            {
                "pair": "USD/CAD",
                "rate": 1.37,
                "exponent": 0.091
            },
            {
                "pair": "USD/SEK",
                "rate": 10.5,
                "exponent": 0.042
            },
            {
                "pair": "USD/CHF",
                "rate": 0.91,
                "exponent": 0.036
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:21.538Z",
        "request_id": "90a8ca4d-0c61-45f8-b00c-096c23b72247"
    },
    "status": "ok",
    "message": "Dollar index computed",
    "success": true
}
```

#### `GET /v1/index` — Custom weighted index (geometric/arithmetic)

**Parameters:**
- `components` (query, required, string) — rate:weight pairs, comma-separated Example: `1.08:-0.576,150:0.136`
- `method` (query, optional, string) — geometric (default) or arithmetic Example: `geometric`
- `constant` (query, optional, string) — Scaling constant (default 1) Example: `50.14348112`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/currencyindex-api/v1/index?components=1.08%3A-0.576%2C150%3A0.136&method=geometric&constant=50.14348112"
```

**Response:**
```json
{
    "data": {
        "legs": [
            {
                "rate": 1.08,
                "weight": -0.576
            },
            {
                "rate": 150,
                "weight": 0.136
            }
        ],
        "note": "Geometric index = constant x product(rate^weight). Use negative weights for inversely-quoted pairs (as DXY does).",
        "value": 94.822371,
        "method": "geometric",
        "source": "CURRENCY-INDEX",
        "constant": 50.14348112,
        "components": 2
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:21.636Z",
        "request_id": "d0808768-d896-40cf-8740-4d3feff7e4b7"
    },
    "status": "ok",
    "message": "Index computed",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "Rates are the quoted FX rates. DXY needs eurusd,usdjpy,gbpusd,usdcad,usdsek,usdchf. The index endpoint takes components=rate:weight; basket takes components=current:base:weight.",
        "source": "Computed in-process from caller-supplied exchange rates (no upstream)",
        "service": "currencyindex-api",
        "endpoints": {
            "GET /v1/dxy": "US Dollar Index from its 6 components (eurusd=1.08&usdjpy=150&gbpusd=1.27&usdcad=1.37&usdsek=10.5&usdchf=0.91).",
            "GET /v1/meta": "This document.",
            "GET /v1/index": "Custom weighted index, geometric or arithmetic (components=1.08:-0.576,150:0.136&method=geometric&constant=50.14).",
            "GET /v1/basket": "Trade-weighted index normalised to 100 (components=1.08:1.10:0.5,150:148:0.5)."
        },
        "description": "Live currency-index maths computed on demand from exchange rates. The dxy endpoint computes the US Dollar Index from its six component rates using the official ICE weights; the index endpoint builds an arbitrary geometric or arithmetic weighted index from your components with a scaling constant; the basket endpoint computes a trade-weighted index normalised to 100, showing how a currency moved against a basket from reference rates. An index-construction engine, distinct from published effective-exchange-rate feeds and strength meters: you supply rates and weights, it returns the index. Computed locally, nothing stored.",
        "upstream_statu
…(truncated, see openapi.json for full schema)
```


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