# Tipos de cambio oficiales: Banxico y TRM (`tasavera/latam-official-exchange-rates`) Actor

Tipo de cambio oficial por fecha: TRM de Colombia (Superfinanciera) y FIX, dólar de liquidación y UDI de Banco de México (con su propio token gratuito). Lotes de fechas de factura. Official LatAm FX rates, bilingual.

- **URL**: https://apify.com/tasavera/latam-official-exchange-rates.md
- **Developed by:** [Tasavera](https://apify.com/tasavera) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 exchange rates

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Tipos de cambio oficiales LatAm: FIX y UDI Banxico, TRM Colombia

**English summary:** Official exchange rates by date for invoices and accounting. Colombia's TRM (Superintendencia Financiera, via datos.gov.co, CC BY-SA 4.0) works with no key. Mexico's FIX, settlement-date dollar and UDI come from Banco de México's SIE API using **your own free Banxico token**. Send a list of invoice dates and get the official rate for each. Every row has a `fuente` credit. Argentina is not included (see below). Not affiliated with Banco de México, Superfinanciera or any government.

### ¿Qué hace?

- **Colombia:** TRM en COP por USD con su vigencia (desde y hasta). Sin token.
- **México:** FIX (SF43718), dólar fecha de liquidación (SF60653) y UDI (SP68257). Requiere su token SIE gratuito: https://www.banxico.org.mx/SieAPIRest/service/v1/token
- **Modo lote:** escriba fechas de factura (AAAA-MM-DD). Para Colombia devuelve la TRM vigente ese día. Para México devuelve el dato de esa fecha o, si no hay (fin de semana o día festivo), el último publicado antes, y lo indica en `regla`.
- **Modo rango:** todos los datos entre dos fechas (predeterminado: últimos 7 días).

### Entrada

| Campo | Ejemplo |
|---|---|
| paises | \["CO", "MX"] |
| fechas | \["2026-10-18", "2026-01-01"] |
| fechaInicio / fechaFin | 2026-10-01 / 2026-10-19 |
| seriesMexico | \["FIX", "UDI"] |
| banxicoToken | su token (campo secreto, cifrado, nunca se muestra) |
| maxItems | 100 |

### Ejemplo de renglón

```json
{ "pais": "CO", "indicador": "TRM, COP por USD", "valor": 3174.67, "unidad": "COP por 1 USD",
  "fecha_solicitada": "2026-10-18", "vigente_desde": "2026-10-17", "vigente_hasta": "2026-10-19",
  "regla": "TRM vigente en la fecha", "licencia": "CC BY-SA 4.0",
  "fuente": "Fuente: Portal de Datos Abiertos www.datos.gov.co ..." }
```

### Importante

Entregamos el **dato oficial tal como se publica**. No damos asesoría fiscal: confirme con su contador qué fecha y qué tipo de cambio aplica a cada comprobante (por ejemplo, CFDI en México).

### Qué cambiamos

Solo seleccionamos la fecha y damos formato (AAAA-MM-DD, números). Los valores no se modifican.

### Fuentes y licencias

- **Colombia:** "Fuente: Portal de Datos Abiertos www.datos.gov.co", conjunto Tasa de Cambio Representativa del Mercado- TRM (32sa-8pi3), Superintendencia Financiera de Colombia. Licencia del conjunto: Creative Commons Attribución-CompartirIgual 4.0 (CC BY-SA 4.0). Los renglones de Colombia que usted reciba quedan bajo esa misma licencia.
- **México:** Banco de México, SIE, https://www.banxico.org.mx. Banxico autoriza de manera general reproducir o usar su información citando la fuente y su dirección de Internet. Banxico limita cada token (80 consultas por minuto, 40,000 por día para datos oportunos).
- **Argentina (no incluida):** el aviso legal del BCRA dice: "No está permitido utilizar los contenidos con fines comerciales, publicitarios o de campaña sin autorización previa y expresa del BCRA."

Esta herramienta no está afiliada a Banco de México, a la Superintendencia Financiera de Colombia ni a ningún gobierno, y ninguno la respalda.

### Privacidad

Solo indicadores públicos. No hay datos de personas. Su token no se guarda en el resultado ni en el log.

# Actor input Schema

## `paises` (type: `array`):

México requiere su propio token gratuito del SIE de Banxico.

## `fechas` (type: `array`):

Opcional. Lista AAAA-MM-DD. Para cada fecha devuelve el tipo vigente o el último publicado en o antes de esa fecha. Si se llena, se ignora el rango.

## `fechaInicio` (type: `string`):

AAAA-MM-DD. Vacío = hace 7 días.

## `fechaFin` (type: `string`):

AAAA-MM-DD. Vacío = hoy.

## `seriesMexico` (type: `array`):

Solo México. FIX y UDI por omisión.

## `banxicoToken` (type: `string`):

Su token gratuito de 64 caracteres: https://www.banxico.org.mx/SieAPIRest/service/v1/token . Se guarda cifrado y nunca se muestra en el resultado ni en el log.

## `maxItems` (type: `integer`):

Máximo de renglones / Max rows

## Actor input object example

```json
{
  "paises": [
    "CO"
  ],
  "seriesMexico": [
    "FIX",
    "UDI"
  ],
  "maxItems": 100
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `resultsJson` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "paises": [
        "CO"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("tasavera/latam-official-exchange-rates").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "paises": ["CO"],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("tasavera/latam-official-exchange-rates").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "paises": [
    "CO"
  ],
  "maxItems": 100
}' |
apify call tasavera/latam-official-exchange-rates --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tasavera/latam-official-exchange-rates"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5tE64qyn5bUvhLGUz/builds/0Fo1BO4qCbv7t6eRb/openapi.json
