<!-- https://pricto.dev/docs/api/get-fx-rate · Spanish version: https://pricto.dev/docs/api/get-fx-rate.md -->

# Exchange rate used for conversions

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

Exchange rate used for conversions

| Credits | MCP |
|---|---|
| 0 | — |

## Parameters

| Parameter | In | Type | Description |
|---|---|---|---|
| `base` **required** | query | `string` |  |
| `quote` **required** | query | `string` |  |
| `date` | query | `string (date)` |  |

## Response

`200` The rate.

| Field | Type | Description |
|---|---|---|
| `data` **required** | `FxRate` |  |
| `data.base` **required** | `string` |  |
| `data.quote` **required** | `string` |  |
| `data.rate` **required** | `number` |  |
| `data.date` **required** | `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` **required** | `string` |  |
| `meta` **required** | `Meta` |  |

`meta` carries the cost, the source line to quote, the language, the currency and notices (see [Conventions](/docs/convenciones)).

## Errors

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

## Example

```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"
    ]
  }
}
```
