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 -s 'https://www.datos.gov.co/resource/32sa-8pi3.json?$order=vigenciadesde%20DESC&$limit=3'Real response (November 21, 2026):
[{"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
fromDateandtoDate, newest TRM first, up to 400 rows. - JSON with
date_from,date_toand a numericvalue_cop_per_usd, plus a summary inlatest. - 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 from | In force until | TRM (pesos per dollar) |
|---|---|---|
| 2026-11-21 | 2026-11-23 | 3,461.92 |
| 2026-11-20 | 2026-11-20 | 3,415.10 |
| 2026-11-19 | 2026-11-19 | 3,326.96 |
| 2026-11-18 | 2026-11-18 | 3,309.55 |
| 2026-11-14 | 2026-11-17 | 3,316.70 |
| 2026-11-13 | 2026-11-13 | 3,301.91 |
| 2026-11-11 | 2026-11-12 | 3,297.07 |
| 2026-11-10 | 2026-11-10 | 3,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
| Parameter | What it does |
|---|---|
date | A day (YYYY-MM-DD): returns the TRM in force that day. Not combined with fromDate/toDate |
fromDate / toDate | From and to (YYYY-MM-DD, inclusive): every TRM whose validity falls in the range |
maxItems | Maximum 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 -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:
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):
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.7From 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.
{
"mcpServers": {
"better-llama": {
"url": "https://mcp.betterllama.com/mcp"
}
}
}claude mcp add --transport http better-llama https://mcp.betterllama.com/mcpSetup 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:
{
"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
- Chile open data APIs: official sources by API and MCP — map of the official Chilean sources available by API and MCP, how to find the tool with search_tools, one real call per family and an index of every guide.
- Colombia SECOP II API: public procurement contracts and processes — Open data from datos.gov.co with no key, curl and Python examples, and MCP usage.
- Peru BCRP API: exchange rate, inflation and rates — BCRPData series with no key, curl and Python examples, and MCP usage.
- Chile economic indicators API: UF, dollar, euro, CPI and TPM — One real call per indicator (UF, dollar, euro, UTM, CPI, TMC, TIP, TPM, Imacec, GDP, unemployment and real exchange rate), from the CMF or the Central Bank, with curl, Python, JavaScript and MCP.
- Chile public procurement API: Mercado Público tenders and purchase orders — ChileCompra ticket, curl and Python examples, and MCP usage.
- Chile fuel prices API: gasoline 93, 95, 97, diesel and LPG from Bencina en Línea — CNE data with no sign-up, the cheapest by comuna or near a point, curl, Python and JavaScript examples, and MCP usage.
- Chilexpress API: coverage by comuna, shipping quotes and tracking — covered comunas and sectors with their code and no key, names that differ from the official ones, quotes and tracking with your free keys, and MCP usage.
- Chile earthquakes API: latest quake, magnitude, depth and alerts — Public-domain USGS data with Chile local time, no USGS key, curl and Python examples, and MCP usage.
- Chile public holidays API: 2026 holidays, business days and RUT — National, regional and local holidays with no key, curl and Python examples, and MCP usage.
- Chile Official Gazette API: laws, decrees and new companies — Laws, decrees, notices and company incorporations with CVE and official PDF, no key, curl and Python examples, and MCP usage.
- Banxico API: Mexico's FIX exchange rate, UDIS and TIIE — Banco de México SIE indicators with no token to request, curl and Python examples, and MCP usage.
- Chile electricity market API: marginal cost, generation and demand — Coordinador Eléctrico Nacional grid data with no user_key to request, curl and Python examples, and MCP usage.
- Chile CMF API: UF value, dollar, UTM and maximum conventional rate — the seven API CMF Bancos series with no API key to request, curl and Python examples, and MCP usage.
- Chile USD/CLP exchange rate API: the observed dollar as JSON — today's rate, daily series by month, range or year and the warning for values published in advance, with CMF data, curl, Python and JavaScript examples, and MCP usage.
- Chile UF API: the Unidad de Fomento value as JSON — today's UF, full month, next month's days already published, range or year, with CMF data and a Central Bank cross-check, curl, Python and JavaScript examples, and MCP usage.
- Central Bank of Chile API: BDE series as JSON — dollar, UF, policy rate, CPI, Imacec, GDP, unemployment and any series by code, series search, curl, Python and JavaScript examples, and MCP usage.
- Chile RUT validation API: check digit as JSON — the modulo 11 algorithm, accepted formats, computing the check digit, batches and privacy, curl, Python and JavaScript examples, and MCP usage.
- Chile communes API: regions, provinces and CUT codes — all 346 communes with CUT codes, region filters, name search, curl, Python and JavaScript examples, and MCP usage.
- Chile business days API: deadlines and business-day counts — business-day deadlines from a notice date, Saturdays as business days, calendar days, business days per month, regional holidays and edge cases, with curl, Python and JavaScript, and MCP usage.
This guide is also available en español.