<!-- https://pricto.dev/docs/api/get-fx-rate · versión en inglés: https://pricto.dev/docs/api/get-fx-rate.en.md -->

# Tipo de cambio usado en las conversiones

`GET https://pricto.dev/v1/fx`

Exchange rate used for conversions

| Créditos | MCP |
|---|---|
| 0 | — |

## Parámetros

| Parámetro | En | Tipo | Descripción |
|---|---|---|---|
| `base` **requerido** | query | `string` |  |
| `quote` **requerido** | query | `string` |  |
| `date` | query | `string (date)` |  |

## Respuesta

`200` The rate.

| Campo | Tipo | Descripción |
|---|---|---|
| `data` **requerido** | `FxRate` |  |
| `data.base` **requerido** | `string` |  |
| `data.quote` **requerido** | `string` |  |
| `data.rate` **requerido** | `number` |  |
| `data.date` **requerido** | `string (date)` | Date the rate applies to. |
| `data.published_date` | `string (date)` |  |
| `data.kind` | `string` | Valores / values: `official`, `mep`. |
| `data.method` | `string` | Valores / values: `direct`, `cross`. |
| `data.source` **requerido** | `string` |  |
| `meta` **requerido** | `Meta` |  |

`meta` trae el costo, la fuente para citar, el idioma, la moneda y los avisos (ver [Convenciones](/docs/convenciones)).

## Errores

- [`not_found`](/docs/errores#not_found)

## Ejemplo

```bash
curl "https://pricto.dev/v1/fx?base=CLP&quote=USD" \
  -H "Authorization: Bearer sk_test_sandbox"
```
```python
import requests

API_KEY = "sk_test_sandbox"

r = requests.get(
    "https://pricto.dev/v1/fx",
    params={"base": "CLP", "quote": "USD"},
    headers={"Authorization": f"Bearer {API_KEY}"},
)
print(r.status_code, r.json())
```
```js
const API_KEY = "sk_test_sandbox";

const res = await fetch(`https://pricto.dev/v1/fx?${new URLSearchParams({"base":"CLP","quote":"USD"})}`, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
console.log(res.status, await res.json());
```

```json
{
  "data": {
    "base": "CLP",
    "quote": "USD",
    "date": "2026-10-23",
    "published_date": "2026-10-23",
    "kind": "official",
    "method": "direct",
    "source": "bcch-dolar-observado (synthetic)",
    "rate": 0.00105164
  },
  "meta": {
    "request_id": "req_5c7742a0acaf42d88894",
    "attribution": {
      "text": "Fuente: Pricto · 23-10-2026 08:00 CLST",
      "source": "Pricto",
      "as_of": "2026-10-23T11:00:00Z",
      "resource_id": null,
      "url": null,
      "capture_method": null,
      "source_url": null
    },
    "credits_charged": 0,
    "credits_deduplicated": 0,
    "credits_remaining": 14988,
    "period_resets_at": "2026-11-01T00:00:00.000Z",
    "usage": {
      "credits_charged": 0,
      "credits_deduplicated": 0,
      "truncated": false,
      "truncated_reason": null,
      "dry_run": false,
      "units": {}
    },
    "lang": "es",
    "currency": "local",
    "data_as_of": "2026-10-23T11:00:00Z",
    "warnings": [
      "synthetic_data: datos sintéticos de ejemplo / synthetic sample data"
    ]
  }
}
```
