Guide · Colombia economic indicators

Colombia TRM API: how to get today's TRM and the history of the dollar in Colombian pesos

How to get Colombia's Tasa Representativa del Mercado (TRM) from your code or an AI agent: what the TRM is, how to query the datos.gov.co open data directly, and how to receive today's TRM, the rate on a date or over a range as clean JSON with Better Llama's MCP tool, with no key.

What is the TRM and who publishes it?

The TRM is the official exchange rate of Colombian pesos per US dollar (COP/USD). The Superintendencia Financiera de Colombia calculates and certifies it from dollar buy and sell trades in the foreign exchange market, and it is used as the reference in contracts, dollar invoices, tax filings and accounting.

Each TRM has a validity period: usually one day, but the one in force over a weekend or holiday covers several days in a row. For example, the TRM of 3,316.70 pesos applied from November 14 to 17, 2026, which includes the weekend and the Monday 16 holiday.

The full history is in the «Tasa de Cambio Representativa del Mercado - TRM» dataset (32sa-8pi3) on the datos.gov.co open data portal, published by the Superintendencia Financiera under the CC BY-SA 4.0 license: you can reuse it, commercially too, citing the source and sharing derived works under the same license.

Two ways to access the TRM by API

1. The datos.gov.co open data API

Like every datos.gov.co dataset, the TRM has a public JSON endpoint (Socrata SODA API) queried with SoQL parameters and no key. For example, the 3 most recent TRM values:

curl · datos.gov.co
curl -s 'https://www.datos.gov.co/resource/32sa-8pi3.json?$order=vigenciadesde%20DESC&$limit=3'

Real response (November 21, 2026):

json
[{"valor":"3461.92","unidad":"COP","vigenciadesde":"2026-11-21T00:00:00.000","vigenciahasta":"2026-11-23T00:00:00.000"}
,{"valor":"3415.1","unidad":"COP","vigenciadesde":"2026-11-20T00:00:00.000","vigenciahasta":"2026-11-20T00:00:00.000"}
,{"valor":"3326.96","unidad":"COP","vigenciadesde":"2026-11-19T00:00:00.000","vigenciahasta":"2026-11-19T00:00:00.000"}]

The integration is on your side: the value arrives as text, dates include a time, and to know which TRM applied on a day you have to filter by validity (vigenciadesde and vigenciahasta), not by exact date, because one row can cover a weekend or holiday.

2. Better Llama's TRM tool (over MCP)

Our Colombia TRM: official COP/USD exchange rate tool, colombia_trm, queries that same dataset and returns the result ready to use:

  • With no arguments, the latest TRM in force; with date, the one that applied that day, even on a weekend or holiday.
  • Ranges with fromDate and toDate, newest TRM first, up to 400 rows.
  • JSON with date_from, date_to and a numeric value_cop_per_usd, plus a summary in latest.
  • Every response includes the source attribution, a link to the dataset and the update date in sourceUpdatedAt.

Use it as an MCP tool from Claude, Cursor or other agents, or over HTTP with JSON-RPC from any language.

Step by step: get the TRM

Step 1. Choose which TRM you need

There are three ways to call colombia_trm: with no arguments for today's TRM (the latest in force), with date for the one that applied on a given day, or with fromDate and toDate for a history. These are the real TRM values from November 10 to 21, 2026, as the tool returns them:

In force fromIn force untilTRM (pesos per dollar)
2026-11-212026-11-233,461.92
2026-11-202026-11-203,415.10
2026-11-192026-11-193,326.96
2026-11-182026-11-183,309.55
2026-11-142026-11-173,316.70
2026-11-132026-11-133,301.91
2026-11-112026-11-123,297.07
2026-11-102026-11-103,269.88

Step 2. Connect the MCP server

Use the MCP https://mcp.betterllama.com/mcp in your client or call it over HTTP with JSON-RPC, as in the examples. This tool needs no key, and no account or sign-up is required during the beta.

Step 3. Build your query

ParameterWhat it does
dateA day (YYYY-MM-DD): returns the TRM in force that day. Not combined with fromDate/toDate
fromDate / toDateFrom and to (YYYY-MM-DD, inclusive): every TRM whose validity falls in the range
maxItemsMaximum rows (1 to 400, default 400)

With no arguments you get the latest TRM in force. Ranges come newest first.

Step 4. Call the tool with curl

A JSON-RPC POST returns the result as JSON. This call, with no arguments, asks for today's TRM:

curl
curl -s https://mcp.betterllama.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "colombia_trm", "arguments": {}}}'

The same in Python

A week of TRM values, with their validity:

python
import json
import requests

URL = "https://mcp.betterllama.com/mcp"
HEADERS = {"Accept": "application/json, text/event-stream"}
arguments = {"fromDate": "2026-11-16", "toDate": "2026-11-21"}
body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
        "params": {"name": "colombia_trm", "arguments": arguments}}
resp = requests.post(URL, json=body, headers=HEADERS, timeout=60)
resp.raise_for_status()
data = json.loads(resp.json()["result"]["content"][0]["text"])
for fila in data["results"]:
    print(fila["date_from"], fila["date_to"], fila["value_cop_per_usd"])

Real output (November 21, 2026, 10:16 Chile time):

output
2026-11-21 2026-11-23 3461.92
2026-11-20 2026-11-20 3415.1
2026-11-19 2026-11-19 3326.96
2026-11-18 2026-11-18 3309.55
2026-11-14 2026-11-17 3316.7

From JavaScript or any other language, a POST with the same JSON-RPC body is all you need (for example, with fetch).

Use the TRM API from an AI agent (MCP)

Add the Better Llama MCP server to your client (Claude, Cursor, VS Code or any other client with remote MCP). One MCP brings colombia_trm and the rest of the catalog, with no sign-up during the beta.

Cursor · mcp.json
{
  "mcpServers": {
    "better-llama": {
      "url": "https://mcp.betterllama.com/mcp"
    }
  }
}
Claude Code
claude mcp add --transport http better-llama https://mcp.betterllama.com/mcp

Setup for Claude, Codex, Gemini CLI, Windsurf, VS Code and other clients: connect your agent.

Ready-to-run Python and Node.js examples, with config files for each client: examples repository on GitHub.

Then ask, for example: “What is Colombia's TRM today and how much did the dollar rise in Colombia over the last week? Cite the source.”

Beta: free and with no sign-up while we test the service.

Which fields it returns

Each row in results has date_from and date_to (validity, ISO format) and value_cop_per_usd (Colombian pesos per 1 dollar, numeric). The response also includes count, latest (the newest TRM in the result, with its unit), warnings, attribution, source (link to the dataset), sourceUpdatedAt (last dataset update on datos.gov.co) and retrievedAt.

Real, complete response to the curl call above (November 21, 2026, 10:14 Chile time). The TRM of 3,461.92 pesos applies from Saturday 21 to Monday 23 November; the dataset was updated on November 20 at 20:05 Chile time:

json
{
  "tool": "colombia_trm",
  "count": 1,
  "latest": {
    "date_from": "2026-11-21",
    "date_to": "2026-11-23",
    "value_cop_per_usd": 3461.92,
    "unit": "COP por 1 USD"
  },
  "results": [
    {
      "date_from": "2026-11-21",
      "date_to": "2026-11-23",
      "value_cop_per_usd": 3461.92
    }
  ],
  "warnings": [],
  "attribution": "Fuente: Superintendencia Financiera de Colombia vía datos.gov.co (Portal de Datos Abiertos www.datos.gov.co, conjunto \"Tasa de Cambio Representativa del Mercado - TRM\", 32sa-8pi3). Licencia CC BY-SA 4.0. La fecha de última actualización del conjunto viene en sourceUpdatedAt.",
  "source": "https://www.datos.gov.co/Econom-a-y-Finanzas/Tasa-de-Cambio-Representativa-del-Mercado-TRM/32sa-8pi3",
  "sourceUpdatedAt": "2026-11-20T23:05:56.000Z",
  "retrievedAt": "2026-11-21T13:14:29.801Z"
}

If you reuse the data, cite «Fuente: Superintendencia Financiera de Colombia vía datos.gov.co» with the update date, and share derived works under the same license (CC BY-SA 4.0).

Pricing

Free during the beta, with no sign-up and a limit of 60 requests per minute per IP. If paid plans come later, we will announce them on betterllama.com first. This tool needs no key.

Frequently asked questions

Is there an API for Colombia's TRM?

Yes. The Superintendencia Financiera publishes the TRM history as open data on datos.gov.co (dataset 32sa-8pi3), with a public JSON endpoint that needs no key. Better Llama's colombia_trm tool queries that dataset and returns the TRM with its validity and numeric value over MCP or JSON-RPC.

How do I get today's TRM by API?

Call colombia_trm with no arguments: it returns the latest TRM in force with its validity. On November 21, 2026 it was 3,461.92 pesos per dollar, in force from November 21 to 23.

Which TRM applies on a weekend or holiday?

The same TRM stays in force for several days in a row and appears as a single row whose validity covers the whole period. If you ask for a date with date, the tool returns the row that includes it.

Do I need a key or token for the TRM API?

No. Neither the datos.gov.co endpoint nor Better Llama's tool needs a key for this query. Better Llama's tool is free during the beta, with a limit of 60 requests per minute per IP.

How up to date is the data?

It is what the Superintendencia Financiera publishes on datos.gov.co at query time, with up to 30 minutes of caching. Every answer includes the dataset update date in sourceUpdatedAt.

Can I reuse the TRM data?

Yes. The dataset is licensed CC BY-SA 4.0: cite «Fuente: Superintendencia Financiera de Colombia vía datos.gov.co» and share derived works under the same license. Every answer carries the attribution field with the citation.

Can I use the TRM API from Claude, Cursor or another AI agent?

Yes. Add the Better Llama MCP server (https://mcp.betterllama.com/mcp) to your client and the agent can use colombia_trm to get today's TRM, the rate on a date or a history in natural language.

Is Better Llama affiliated with the Superintendencia Financiera?

No. Better Llama is an independent project, not affiliated with, sponsored or endorsed by the Superintendencia Financiera de Colombia or datos.gov.co. The data source is the TRM dataset on datos.gov.co, reused under its CC BY-SA 4.0 license.

Other guides

This guide is also available en español.