# 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"
```

#### `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"
```

#### `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"
```

### Meta

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

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


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