# National Bank of Tajikistan API
> Live official exchange-rate data from the National Bank of Tajikistan (NBT), the central bank of the Republic of Tajikistan, for the somoni (TJS): the NBT official rate for every published currency (normalised to one unit), a single currency's somoni-per-unit rate and inverse, a currency's official rate on a specific past date, and currency conversion between any two published currencies (including TJS) cross-computed through the somoni.

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

## Pricing
- **Free** (Free) — 11,000 calls/Mo, 3 req/s
- **Basic** ($7/Mo) — 162,000 calls/Mo, 8 req/s
- **Pro** ($19/Mo) — 1,010,000 calls/Mo, 15 req/s
- **Scale** ($50/Mo) — 5,300,000 calls/Mo, 35 req/s

## Endpoints

### Rates

#### `GET /v1/rate` — One currency somoni-per-unit rate and inverse

**Parameters:**
- `currency` (query, required, string) — 3-letter ISO currency code Example: `USD`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nbt-api/v1/rate?currency=USD"
```

**Response:**
```json
{
    "data": {
        "base": "TJS",
        "date": "2026-06-10",
        "name": "US Dollar",
        "source": "National Bank of Tajikistan",
        "nominal": 1,
        "currency": "USD",
        "tjs_per_unit": 9.3537,
        "unit_per_tjs": 0.10690957
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:53.854Z",
        "request_id": "a04e5eb1-1165-42ab-857a-a193fbe71127"
    },
    "status": "ok",
    "message": "Rate retrieved successfully",
    "success": true
}
```

#### `GET /v1/rates` — NBT official rate for every currency vs the somoni

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

**Response:**
```json
{
    "data": {
        "base": "TJS",
        "date": "2026-06-10",
        "count": 36,
        "rates": [
            {
                "name": "UAE Dirham",
                "value": 2.5464,
                "nominal": 1,
                "currency": "AED",
                "tjs_per_unit": 2.5464
            },
            {
                "name": "Afghanian Afghani",
                "value": 1.454,
                "nominal": 10,
                "currency": "AFN",
                "tjs_per_unit": 0.1454
            },
            {
                "name": "Armenian Dram",
                "value": 2.5381,
                "nominal": 100,
                "currency": "AMD",
                "tjs_per_unit": 0.025381
            },
            {
                "name": "Australian Dollar",
                "value": 6.6037,
                "nominal": 1,
                "currency": "AUD",
                "tjs_per_unit": 6.6037
            },
            {
                "name": "Azeri Manat",
                "value": 5.5022,
                "nominal": 1,
                "currency": "AZN",
                "tjs_per_unit": 5.5022
            },
            {
                "name": "New Belarusian Ruble",
                "value": 3.4047,
                "nominal": 1,
                "currency": "BYN",
                "tjs_per_unit": 3.4047
            },
            {
                "name": "Canadian Dollar",
                "value": 6.7143,
                "nominal": 1,
               
…(truncated, see openapi.json for full schema)
```

### History

#### `GET /v1/history` — A currency official rate on a specific past date

**Parameters:**
- `currency` (query, required, string) — 3-letter ISO currency code Example: `USD`
- `date` (query, required, string) — Date YYYY-MM-DD Example: `2026-05-15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nbt-api/v1/history?currency=USD&date=2026-05-15"
```

**Response:**
```json
{
    "data": {
        "base": "TJS",
        "date": "2026-05-15",
        "name": "US Dollar",
        "source": "National Bank of Tajikistan",
        "nominal": 1,
        "currency": "USD",
        "tjs_per_unit": 9.352,
        "unit_per_tjs": 0.106929
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:54.915Z",
        "request_id": "1b6910df-f8fe-4895-92ac-635455f03132"
    },
    "status": "ok",
    "message": "History retrieved successfully",
    "success": true
}
```

### Convert

#### `GET /v1/convert` — Convert an amount between two currencies at NBT rates

**Parameters:**
- `from` (query, required, string) — Source currency Example: `USD`
- `to` (query, required, string) — Target currency Example: `EUR`
- `amount` (query, optional, string) — Amount to convert Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nbt-api/v1/convert?from=USD&to=EUR&amount=100"
```

**Response:**
```json
{
    "data": {
        "to": "EUR",
        "date": "2026-06-10",
        "from": "USD",
        "rate": 0.86422685,
        "amount": 100,
        "result": 86.422685,
        "source": "National Bank of Tajikistan",
        "tjs_per_to": 10.8232,
        "tjs_per_from": 9.3537
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:55.226Z",
        "request_id": "b4128f05-5d49-4cd8-96cf-a4a09386778c"
    },
    "status": "ok",
    "message": "Conversion completed successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata and endpoint catalog

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

**Response:**
```json
{
    "data": {
        "source": "National Bank of Tajikistan daily rate file (nbt.tj, live)",
        "service": "nbt-api",
        "usd_tjs": 9.3537,
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/rate": "One currency's official rate, somoni-per-unit and inverse (currency=USD).",
            "GET /v1/rates": "The NBT official rate for every currency vs the somoni.",
            "GET /v1/convert": "Convert an amount between two currencies at NBT rates (from=USD, to=EUR, amount=100).",
            "GET /v1/history": "A currency's official rate on a specific past date (currency=USD, date=2026-05-15)."
        },
        "description": "Live official exchange-rate data from the National Bank of Tajikistan (NBT), the central bank of the Republic of Tajikistan, for the somoni (TJS), via its public daily rate file. The rates endpoint returns the NBT's official rate for every published currency against the somoni, normalised to one unit; the rate endpoint returns a single currency's official rate (somoni-per-unit and the inverse); the history endpoint returns a currency's official rate on a specific past date; the convert endpoint converts an amount between any two published currencies (including TJS) at the NBT's official rates, cross-computed through the somoni. Live, no key, nothing stored. Distinct from the ECB, SNB, NBU, HNB, NBG, NBRB, CBU, CBAR, BOI, NBK, BNM and other central-bank feeds and from market mid-rates — this is the Na
…(truncated, see openapi.json for full schema)
```


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