Skip to content

Exchange rates

Reference exchange rates (not trading prices) from one base currency, latest or on a date. frankfurter supports any base daily; ecb supports base EUR; us-treasury supports base USD with quarterly rates; bcb-ptax supports a foreign base with quote BRL.

Endpoint POST /v1/exchange-rate-queries
Scope exchange_rate:query
MCP tool exchange_rate
Usage units rates

Usage units appear in execution.usage.units for reconciliation and billing.

Field Type Required Description
invocation_id string yes The market’s invocation id: one execution per id and operation, so a retry with the same id is rejected instead of charged twice. 1-128 characters of A-Z a-z 0-9 . _ : -.
provider string yes Provider that serves the request; choose by the coverage described for this tool. One of: frankfurter, us-treasury
base string yes ISO 4217 base currency, for example USD or EUR.
quotes string[] yes 1-20 ISO 4217 quote currencies.
date string no Optional YYYY-MM-DD; omitted means the latest published rates.
Provider Region Source Limits
frankfurter EU Frankfurter (ECB and other reference rates), any base, daily max_quotes: 20, timeout_seconds: 30
us-treasury US US Treasury rates, base USD, quarterly max_quotes: 20, timeout_seconds: 30
终端窗口
curl -sS https://services.zgi.im/v1/exchange-rate-queries \
-H "Authorization: Bearer $ZGI_SERVICES_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"invocation_id": "docs-1791778521-exchange_rate", "provider": "frankfurter", "base": "USD", "quotes": ["CNY", "EUR"], "date": "2026-10-09"}'

A real response, with lists cut to two items and long text shortened.

{
"code": 0,
"message": "success",
"data": {
"execution": {
"id": "exe_01a12e52a9647c6a80db06795b1a868e",
"invocation_id": "docs-1791778521-exchange_rate",
"capability": "exchange_rate",
"operation": "exchange_rate.query",
"provider": "frankfurter",
"outcome": "succeeded",
"error_category": null,
"error_code": null,
"usage": {
"provider_requests": 1,
"units": [
{
"name": "rates",
"value": 2,
"source": "measured"
}
]
},
"upstream_ref": null,
"request_id": "req_fda09169da0b3aea3c6190c0",
"started_at": "2026-10-12T04:15:31.684811913Z",
"finished_at": "2026-10-12T04:15:32.12019483Z",
"duration_ms": 435
},
"result": {
"base": "USD",
"rate_date": "2026-10-09",
"requested_date": "2026-10-09",
"rates": [
{
"quote": "CNY",
"rate": 6.693
},
{
"quote": "EUR",
"rate": 0.89154
}
],
"unavailable_quotes": [],
"source": {
"name": "Frankfurter (central bank reference rates)",
"kind": "reference"
},
"retrieved_at": "2026-10-12T04:15:32.120169681Z"
}
}
}