BYTETOOLS

Colombia TRM (datos.gov.co) API

Free API for Colombia's official TRM exchange rate on datos.gov.co: the representative market rate with its validity window, queryable by date. No key, tested example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 21 Aug 2026

What is the Colombia TRM (datos.gov.co) API?

Colombia's official TRM exchange rate is published as an open dataset on datos.gov.co and served through a free Socrata API with no key. Each record gives the rate and the date range over which it is valid.

The TRM — Tasa Representativa del Mercado — is Colombia's official peso-to-dollar rate, and it is the number Colombian invoicing, customs and tax calculations use. Because it is published as an open dataset rather than a bespoke API, you get the full Socrata query language for free: filtering, ordering, aggregation and paging all work through `$where`, `$order` and `$limit` without any custom syntax to learn.

The record shape encodes something most FX feeds do not: a validity window. `vigenciadesde` and `vigenciahasta` bracket the period a rate applies to, and for a Friday publication that window often spans the weekend rather than being a single day. Query by whether your transaction date falls inside the window rather than matching it against a single date field, or Saturday transactions will find no rate at all.

Quick facts

Base URL
https://www.datos.gov.co/resource
Authentication
No key required for moderate use. Socrata offers a free app token that raises the throttling ceiling but is optional.
Rate limit
Unauthenticated requests share a per-IP throttle. An optional free app token lifts it.
Pricing
Free. Published under Colombia's open data programme.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Colombia TRM (datos.gov.co) API

Every request below was executed against the live API on 21 Aug 2026, and the response shown is the real body it returned — not an illustration.

1. Most recent official TRM value

GET https://www.datos.gov.co/resource/32sa-8pi3.json?$limit=1&$order=vigenciadesde%20DESC

curl
curl 'https://www.datos.gov.co/resource/32sa-8pi3.json?$limit=1&$order=vigenciadesde%20DESC'
JavaScript (fetch)
const res = await fetch("https://www.datos.gov.co/resource/32sa-8pi3.json?$limit=1&$order=vigenciadesde%20DESC");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://www.datos.gov.co/resource/32sa-8pi3.json?$limit=1&$order=vigenciadesde%20DESC", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
[
  {
    "valor": "3062.96",
    "unidad": "COP",
    "vigenciadesde": "2026-08-21T00:00:00.000",
    "vigenciahasta": "2026-08-21T00:00:00.000"
  }
]

Parameters

ParameterTypeRequiredDescription
dataset idpath segmentRequiredSocrata dataset identifier. `32sa-8pi3` is the historical TRM series. 32sa-8pi3.json
$limitqueryOptionalNumber of records to return. Defaults to 1000. 1
$orderqueryOptionalSort expression. `vigenciadesde DESC` puts the newest rate first. vigenciadesde DESC
$wherequeryOptionalSoQL filter, for example a date-window test against `vigenciadesde` and `vigenciahasta`. vigenciadesde <= '2026-08-20'

Response fields

valorstring
The TRM, in pesos per US dollar, returned as a string. Parse before arithmetic.
unidadstring
Currency unit of the value — `COP`.
vigenciadesdestring
First date the rate is valid from, as an ISO timestamp.
vigenciahastastring
Last date the rate is valid until. Often spans a weekend for Friday publications.

What you can build with the Colombia TRM (datos.gov.co) API

  • Convert dollar amounts for Colombian invoicing and customs at the official rate
  • Look up the TRM valid on a given transaction date using a window query
  • Chart the TRM over a period by ordering and limiting the dataset
  • Reconcile accounting entries against the officially published rate

Common errors and how to fix them

No record for a weekend date

You matched on equality instead of the validity window.

Fix: Filter with `vigenciadesde <= date AND vigenciahasta >= date`. Friday rates commonly cover Saturday and Sunday.

429

Unauthenticated per-IP throttling.

Fix: Cache the daily value, or register a free Socrata app token to raise the ceiling.

String arithmetic errors

`valor` is a string, not a number.

Fix: Parse to a decimal type explicitly. Socrata returns numeric columns as strings in JSON.

Colombia TRM (datos.gov.co) API — frequently asked questions

What is the TRM in Colombia?

The Tasa Representativa del Mercado is the official peso-to-dollar exchange rate, calculated from market transactions and used for invoicing, customs and tax purposes. It is published with a validity window rather than for a single day.

Do I need an API key for datos.gov.co?

No. Unauthenticated requests work and share a per-IP throttle. A free Socrata app token raises that ceiling but is optional and does not change the data.

Why does a rate cover more than one day?

The TRM published on a Friday typically remains valid through the weekend. `vigenciadesde` and `vigenciahasta` bracket the exact period, which is why you should query the window rather than a single date.

How far back does the dataset go?

The historical TRM dataset covers many years of daily publications. Use `$order` and `$limit` to page through it rather than fetching everything at once.

Tools that pair with this API

Alternatives to Colombia TRM (datos.gov.co) API

If Colombia TRM (datos.gov.co) does not fit, these finance & crypto apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.

APIWhat it doesAuthCORSLast verified
CoinGeckoFree cryptocurrency price API covering 10,000+ coins. Live prices, market cap and volume in any currency, no API key on the public tier. Tested curl example.No keyYes19 Aug 2026
Binance Public APIBinance public market data API needs no API key: live ticker prices, order books, klines and 24h stats for every trading pair. Tested curl example and response.No keyYes19 Aug 2026
Coinbase Exchange RatesCoinbase public exchange rates API with no key: convert any cryptocurrency to 100+ fiat currencies in a single request. Tested curl example and live JSON.No keyYes19 Aug 2026
FrankfurterFree currency exchange rate API with no key, built on European Central Bank data. Latest and historical rates, time series and conversion. Tested curl example.No keyYes19 Aug 2026
Croatian National BankFree Croatian National Bank API with no key: official EUR buying, middle and selling rates for every quoted currency, current or for any past date. Tested example included.No keyNo21 Aug 2026
Crypto Fear & Greed IndexFree Crypto Fear and Greed Index API with no key: a daily 0-100 sentiment score with its classification and history back to 2018. Tested curl example and live response.No keyYes21 Aug 2026
All Finance & Crypto APIs

Colombia TRM (datos.gov.co) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 21 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.