# Number & Currency Formatter API
> Format numbers for any locale using full ICU data — the correct way to display money, percentages and measurements per region. Pass a value and a style and the format endpoint returns the locale-correct string: decimal, currency (any ISO 4217 code, with the right symbol and grouping — e.g. 1.234.567,89 € in de-DE, $1,234,567.89 in en-US, ￥1,234,567 in ja-JP, and the Indian lakh grouping 12,34,567.89 in hi-IN), percent, or unit (e.g. 80 km/h). Control the locale (BCP 47), minimum/maximum fraction digits, grouping, sign display and notation (standard, scientific, engineering or compact like 1.2M). A parts endpoint returns the formatToParts breakdown (integer, group, decimal, fraction, currency symbol…) for building custom-styled displays. Everything is computed locally with no network calls. Ideal for internationalised UIs, invoices and receipts, dashboards and reports. A locale number/currency formatter — distinct from foreign-exchange rates (currency), number-to-words (numberwords) and the numeral-base converter (baseconvert). No upstream key, no cache.

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

## Pricing
- **Free** (Free) — 2,080 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 39,500 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 210,000 calls/Mo, 20 req/s
- **Mega** ($52/Mo) — 805,000 calls/Mo, 50 req/s

## Endpoints

### Number Format

#### `GET /v1/format` — Format a number for a locale

**Parameters:**
- `value` (query, required, string) — The number Example: `1234567.89`
- `style` (query, optional, string) — decimal, currency, percent, unit Example: `currency`
- `currency` (query, optional, string) — ISO 4217 (for style=currency) Example: `EUR`
- `locale` (query, optional, string) — BCP 47 locale Example: `de-DE`
- `notation` (query, optional, string) — standard, scientific, engineering, compact

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/numberformat-api/v1/format?value=1234567.89&style=currency&currency=EUR&locale=de-DE"
```

#### `GET /v1/parts` — formatToParts breakdown

**Parameters:**
- `value` (query, required, string) — The number Example: `1234.5`
- `locale` (query, optional, string) — BCP 47 locale Example: `en-US`
- `style` (query, optional, string) — decimal, currency, percent, unit
- `currency` (query, optional, string) — ISO 4217 (for style=currency)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/numberformat-api/v1/parts?value=1234.5&locale=en-US"
```

### Meta

#### `GET /v1/meta` — Styles, notations & locales

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


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