Historical forex OHLC bars (gzip required)
get_forex_barsHistorical forex exchange rates: OHLC candles for currency pairs such as EURUSD, USDJPY, GBPUSD and AUDUSD, 1-minute to monthly intervals, up to 2,000 rows per call, paginated. Costs $0.01 USDC per call, paid with x402 on Base; failed calls are not charged.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pair": "<pair>",
"start": "<start>"
},
"name": "get_forex_bars"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Inclusive upper bound. Default now. | |
| pair | Yes | DEX pair (TOKEN0-TOKEN1) or FX pair (e.g. EURUSD). | |
| limit | No | ||
| order | No | Sort direction by time. `asc` (default) returns oldest→newest. `desc` returns newest→oldest and anchors the first page at the most recent bar, so fetching the latest N costs one request instead of paging the whole window. Supported on commodities and forex only; other historical routes are ascending-only. | asc |
| start | Yes | Inclusive lower bound (YYYY-MM-DD or RFC3339). Required. | |
| cursor | No | Opaque pagination cursor from a previous response's `meta.next_cursor`. | |
| interval | No | Bar interval. Default 1m. All `/v1/hist/*` routes accept the same set: intraday (1m–1h), plus `1d` (UTC calendar day), `1w` (Monday-aligned), and `1mo` (calendar month). Coarser bars are aggregated from 1-minute history; a `1d`/`1w`/`1mo` bar opens at midnight UTC of the period start. | 1m |