API Reference: Forex Rates and Bars
Details
Docs navigation
- Getting started: Quickstart, Authentication, Rate limits, Errors and retries
- Guides: Symbol formats, Timestamps and time zones, Pagination, Split and dividend adjustments, WebSocket streaming, Dataset downloads, Excel and Google Sheets, Changelog
- API reference: Stock bars, Stock trades and quotes, Snapshots and movers, Tickers, exchanges, calendar, Splits and dividends, Fundamentals and SEC filings, Options chain and Greeks, Options EOD, bars, OI, Forex (you are here), Crypto, Crypto derivatives, Futures bars and continuous, Settlements and COT, Indices, Economic data, Technical indicators
- SDKs: Python, JavaScript
Five forex endpoints cover everything from "what is EUR/USD now" to every tick of the last year: latest rates, a convert call, daily history, intraday bars and ticks. This page documents each forex API endpoint with its parameters and fields, and explains the two things that trip people up with FX data: there is no central volume, and every vendor ends the trading day at a different time.
Early access. Planned v1 endpoints, not live yet. Free: hourly mid rates, full daily history delayed one day, 1-hour bars for 30 days, 1,000 calls a day. Starter ($29/mo): real-time bid, ask and mid, same-day closes, 1-minute bars with 5 years of history. Pro ($79/mo): 1-second bars, history from 2010, bid and ask bars, ticks with 1 year of history, and the WebSocket stream. Our free ECB reference rate samples are live now.
Details
Latest rate
GET https://api.marketdata.co/v1/forex/latest
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
symbol |
string | yes | Pair or comma-separated pairs, e.g. EURUSD,USDJPY |
Fields: symbol, base_currency, quote_currency, timestamp (UTC, milliseconds), bid, ask, mid, and optional spread, day_open, day_high, day_low, change, change_pct, is_delayed.
Details
Convert
GET https://api.marketdata.co/v1/forex/convert?from=EUR&to=JPY&amount=2500
Returns the latest-rate record plus amount and converted_amount (amount times mid). Pairs without a direct market are crossed through USD.
Details
Daily rates
GET https://api.marketdata.co/v1/forex/daily
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
symbol |
string | yes | Pair, e.g. EURUSD |
|
start, end |
string | no | 1 year | Date range |
source |
string | no | marketdata_composite |
Or ecb for ECB euro reference rates |
day_close |
string | no | ny17 |
ny17 (17:00 New York) or utc (00:00 UTC) |
limit, cursor, format |
no | Paging and output |
Response fields
| Field | Type | Description |
|---|---|---|
symbol |
string | Pair |
base_currency, quote_currency |
string | ISO 4217 codes |
date |
string | Trading day |
open, high, low |
number | Mid prices; empty for single fixings |
close |
number | Closing mid, or the fixing when source is a central bank |
average |
number | Average mid over the day (optional) |
close_bid, close_ask |
number | Optional |
tick_count |
integer | Price updates in the day (optional) |
day_close_time |
string | Cut-off used, e.g. 17:00 America/New_York |
source |
string | marketdata_composite or ecb |
Example
Example (curl):
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.marketdata.co/v1/forex/daily?symbol=EURUSD&start=2025-01-01"
Example (Python), a USD-based table from ECB rates:
import os
import requests
import pandas as pd
H = {"Authorization": f"Bearer {os.environ['MARKETDATA_API_KEY']}"}
rows = []
for pair in ["EURUSD", "EURGBP", "EURJPY"]:
r = requests.get("https://api.marketdata.co/v1/forex/daily", headers=H,
params={"symbol": pair, "source": "ecb", "start": "2026-10-01"})
rows += r.json()["results"]
ecb = pd.DataFrame(rows).pivot(index="date", columns="symbol", values="close")
ecb["GBPUSD"] = ecb["EURUSD"] / ecb["EURGBP"]
The ECB source matches our free sample, which starts like this:
date,base,quote,pair,rate
2026-11-18,EUR,USD,EURUSD,1.0968
2026-11-18,EUR,GBP,EURGBP,0.8329
2026-11-18,EUR,JPY,EURJPY,174.85
Source: European Central Bank
Details
Intraday bars
GET https://api.marketdata.co/v1/forex/bars
Parameters: symbol (required), interval (1s, 1m, 5m, 15m, 1h), price_side (mid, bid, ask; default mid), start, end, limit, cursor, format.
Fields: symbol, interval, timestamp (bar start, UTC), price_side, open, high, low, close, plus optional tick_count, vwap (tick-weighted) and average_spread.
Details
Ticks
GET https://api.marketdata.co/v1/forex/ticks
Parameters: symbol, start, end (one day at most per call), limit, cursor, format.
Fields: symbol, timestamp (UTC, millisecond precision or finer), bid, ask, plus optional mid, bid_size, ask_size, source (contributor code) and received_timestamp.
API
Errors for these endpoints
| HTTP | error.code |
When |
|---|---|---|
| 400 | invalid_symbol_format |
EUR/USD or an inverted pair such as USDEUR; the message suggests the right form |
| 400 | range_too_large |
Tick requests over one day |
| 403 | plan_required |
Real-time bid and ask on Free, 1s bars or ticks below Pro |
| 404 | symbol_not_found |
Currency we do not carry |
Watch out
Notes and gotchas
- FX has no consolidated volume.
tick_countcounts price updates, which is what other vendors label "volume". - Daily bars end at 17:00 New York by default, the usual FX convention. Switch to
day_close=utcif you need to line up with crypto days. - The ECB publishes one reference rate per currency each business day, in the afternoon Frankfurt time, and nothing on TARGET holidays. It is a fixing, not a traded close.
- Weekends are empty. The market opens Sunday evening New York time, so Sunday bars belong to Monday's trading day.
- Our rates are a composite of liquidity providers, not one venue. Spreads will differ from your broker's.
Keep reading
Next steps
Details
Was this page useful?
[Yes] [No]
Need a currency or a fixing source we don't list? Tell us on the custom data form.