# Colombia TRM (Peso) FX API
> Live official exchange-rate data for the Colombian peso (COP) — the Tasa Representativa del Mercado (TRM), Colombia's official daily USD/COP reference rate set by the financial regulator and published on the government open-data portal. Served as clean JSON, no key, no cache. Get the latest TRM (pesos per dollar and the inverse); look up the TRM in effect on any past date (the TRM stays valid across the weekend it was set, so any calendar date resolves to its effective rate); pull the daily TRM over any date range; or convert an amount between USD and COP at the latest TRM. Read live from Colombia's open-data portal, nothing cached. This is the official Colombian-peso reference rate — distinct from the ECB, BCRA, BCRP and other central-bank feeds and from market mid-rates: Colombia's own legally-binding USD/COP TRM.

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

## Pricing
- **Free** (Free) — 500 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 22,000 calls/Mo, 8 req/s
- **Pro** ($21/Mo) — 115,000 calls/Mo, 20 req/s
- **Business** ($51/Mo) — 560,000 calls/Mo, 40 req/s

## Endpoints

### Rate

#### `GET /v1/rate` — Latest TRM — pesos per dollar and the inverse

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

**Response:**
```json
{
    "data": {
        "base": "USD",
        "quote": "COP",
        "source": "Banco de la República (Colombia TRM)",
        "valid_to": "2026-06-10",
        "valid_from": "2026-06-10",
        "cop_per_usd": 3581.46,
        "usd_per_cop": 0.0002792157
    },
    "meta": {
        "timestamp": "2026-06-10T22:58:00.063Z",
        "request_id": "26a1523b-82c9-40fc-8094-73925c0f8198"
    },
    "status": "ok",
    "message": "Rate retrieved successfully",
    "success": true
}
```

### Date

#### `GET /v1/date` — The TRM in effect on a given date

**Parameters:**
- `date` (query, required, string) — Date YYYY-MM-DD Example: `2026-06-09`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/colombiatrm-api/v1/date?date=2026-06-09"
```

**Response:**
```json
{
    "data": {
        "base": "USD",
        "date": "2026-06-09",
        "quote": "COP",
        "source": "Banco de la República (Colombia TRM)",
        "valid_to": "2026-06-09",
        "valid_from": "2026-06-06",
        "cop_per_usd": 3588.09,
        "usd_per_cop": 0.0002786998
    },
    "meta": {
        "timestamp": "2026-06-10T22:58:00.360Z",
        "request_id": "2a5ca479-effe-4c6b-af39-ea2eccd93856"
    },
    "status": "ok",
    "message": "Rate retrieved successfully",
    "success": true
}
```

### History

#### `GET /v1/history` — Daily TRM over a date range

**Parameters:**
- `from` (query, required, string) — Start date YYYY-MM-DD Example: `2026-05-01`
- `to` (query, required, string) — End date YYYY-MM-DD Example: `2026-06-09`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/colombiatrm-api/v1/history?from=2026-05-01&to=2026-06-09"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-09",
        "base": "USD",
        "from": "2026-05-01",
        "count": 24,
        "quote": "COP",
        "source": "Banco de la República (Colombia TRM)",
        "history": [
            {
                "date": "2026-05-01",
                "cop_per_usd": 3637.51
            },
            {
                "date": "2026-05-05",
                "cop_per_usd": 3707.58
            },
            {
                "date": "2026-05-06",
                "cop_per_usd": 3723.33
            },
            {
                "date": "2026-05-07",
                "cop_per_usd": 3706.44
            },
            {
                "date": "2026-05-08",
                "cop_per_usd": 3729.27
            },
            {
                "date": "2026-05-09",
                "cop_per_usd": 3747.1
            },
            {
                "date": "2026-05-12",
                "cop_per_usd": 3759
            },
            {
                "date": "2026-05-13",
                "cop_per_usd": 3775.07
            },
            {
                "date": "2026-05-14",
                "cop_per_usd": 3794.91
            },
            {
                "date": "2026-05-15",
                "cop_per_usd": 3784.7
            },
            {
                "date": "2026-05-16",
                "cop_per_usd": 3796.78
            },
            {
                "date": "2026-05-20",
                "cop_per_usd": 3796.87
            },
           
…(truncated, see openapi.json for full schema)
```

### Convert

#### `GET /v1/convert` — Convert an amount between USD and COP at the latest TRM

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

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

**Response:**
```json
{
    "data": {
        "to": "COP",
        "date": "2026-06-10",
        "from": "USD",
        "rate": 3581.46,
        "amount": 100,
        "result": 358146,
        "source": "Banco de la República (Colombia TRM)",
        "cop_per_usd": 3581.46
    },
    "meta": {
        "timestamp": "2026-06-10T22:58:00.910Z",
        "request_id": "d7169636-8ee7-4223-a7d9-fc66d42cfe01"
    },
    "status": "ok",
    "message": "Conversion completed successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

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

**Response:**
```json
{
    "data": {
        "date": "2026-06-10",
        "source": "Colombia open data (datos.gov.co TRM dataset, live)",
        "service": "colombiatrm-api",
        "endpoints": {
            "GET /v1/date": "The TRM in effect on a given date (date=2026-06-09).",
            "GET /v1/meta": "This document.",
            "GET /v1/rate": "Latest TRM — pesos per dollar and the inverse.",
            "GET /v1/convert": "Convert an amount between USD and COP at the latest TRM (from=USD, to=COP, amount=100).",
            "GET /v1/history": "Daily TRM over a date range (from=2026-05-01, to=2026-06-09)."
        },
        "cop_per_usd": 3581.46,
        "description": "Live official exchange-rate data for the Colombian peso (COP) — the Tasa Representativa del Mercado (TRM), Colombia's official daily USD/COP reference rate — from Colombia's government open-data portal. The rate endpoint returns the latest TRM (pesos per dollar and the inverse); the date endpoint returns the TRM in effect on any past date; the history endpoint returns the daily TRM over a date range; the convert endpoint converts an amount between USD and COP at the latest TRM. Live, no key, nothing stored. Distinct from the ECB, BCRA, BCRP and other central-bank feeds and from market mid-rates — this is Colombia's own legally-binding USD/COP TRM.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-10T22:58:01.310Z",
        "request_id": "fc290dee-7b50-4a62-9cd6-c88030e2890d"
…(truncated, see openapi.json for full schema)
```


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