Forex data in Python
Forex prices in Python, in a few lines
Install our client from PyPI and you have live quotes, candles as pandas DataFrames and a live price stream for every pair, gold and the other tickers we offer.
pip install "marketapi-app[pandas,stream]"
from marketapi import MarketAPI
api = MarketAPI("YOUR_API_KEY")
print(api.latest(["EURUSD", "XAUUSD"])) # live quotes
df = api.bars_df("EURUSD", "H1", "2026-11-01", "2026-12-01") # a pandas DataFrame
print(df.tail())
Prices arrive as strings with the pair's exact digits; exact=True keeps them as Decimal in a DataFrame. The client retries after a rate limit or a server error and follows the pages of long histories by itself.
Prices right now
| Ticker | Bid | Ask | Updated |
|---|---|---|---|
| EURUSD | 1.08257 | 1.08288 | 21:57:58 UTC · Market closed |
| XAUUSD | 3793.70 | 3795.49 | 21:57:59 UTC · Market closed |
The prices when this page was opened, exactly as GET /v1/prices/latest returns them. Open a ticker for its live chart.
Endpoints
GET /v1/prices/latest: latest prices for up to many tickers per call.GET /v1/ticksandGET /v1/bars: tick history and OHLC bars.WSS /v1/stream: push updates as prices change.GET /v1/symbols/{symbol}: the full contract specification for a ticker.
Prices are decimal strings with the ticker's exact number of digits, so nothing is rounded on the way, and every time is in UTC.
Other languages and every endpoint: Developers.
Start in two minutes
1000 free credits after email confirmation. After that, $1 per 1,000 credits, with no subscription.
Get a free API key Try the live shell