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

TickerBidAskUpdated
EURUSD1.082571.0828821:57:58 UTC · Market closed
XAUUSD3793.703795.4921: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

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