Forex Market Data API

TickDB covers major, cross and emerging-market currency pairs with live bid/ask quotes, spreads and historical bars via REST and WebSocket for FX monitoring and analysis.

Market Coverage

Exchange / Category Symbols Data Capabilities Frequency
Major Currency Pairs 14
  • Quotes
  • Candlesticks

Live quotes include bid, ask and spread.

Updates during trading sessions
Minor Currency Pairs 42
  • Quotes
  • Candlesticks

Live quotes include bid, ask and spread.

Updates during trading sessions
Exotic Currency Pairs 1,151
  • Quotes
  • Candlesticks

Live quotes include bid, ask and spread.

Updates during trading sessions
Metals 9
  • Quotes
  • Candlesticks

Quote streaming and candlestick queries.

Updates during trading sessions
Energy 5
  • Quotes
  • Candlesticks

Quote streaming and candlestick queries.

Updates during trading sessions
Agriculture 9
  • Quotes
  • Candlesticks

Quote streaming and candlestick queries.

Updates during trading sessions

Candlesticks are queried via REST; live subscriptions use supported channels. Endpoints, fields and historical coverage depend on the instrument, plan permissions and available data. Instrument counts do not imply full capability coverage for every instrument.

Forex, gold and silver price API

Can I query forex and precious metals through the same API?

Yes. EURUSD, gold XAUUSD and silver XAGUSD are documented examples. Precious metals use the forex product type, with ticker subscriptions and bar queries. Accessible instruments depend on your entitlements.

What do bid, ask and spread mean?

When available, bid_price is the best bid, ask_price the best ask and spread the bid/ask spread; timestamp is in milliseconds. These quote fields are not a full order book or a record of executed trades.

How do I query historical bars?

Bars support 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w and 1M: lowercase m means minutes, uppercase M means months. start_time/end_time use milliseconds; the default is 100 bars, capped at 1,000. The last bar may still be forming. Historical access depends on entitlements and availability.

Code Examples

REST queries

Use documented symbols as examples; confirm current availability and account permissions in the catalog. Replace YOUR_API_KEY locally; never publish a real key in browser code.

Find symbols
curl --fail-with-body -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/symbols/available?market=GLOBAL&type=forex&limit=100&offset=0"
Quote snapshot
curl --fail-with-body -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/market/ticker?symbols=XAUUSD&type=forex"
Daily bars
curl --fail-with-body -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/market/kline?symbol=XAUUSD&type=forex&interval=1d&limit=100"
Gold / Forex
curl --fail-with-body -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/market/ticker?symbols=XAUUSD,XAGUSD,EURUSD&type=forex"

Free is a 7-day trial for selected instruments, with quotes and permitted bar queries. It does not allow start_time/end_time historical ranges. Depth, trades and specified historical ranges require the appropriate entitlements; check the current plan for symbols and quotas.

Quick Start

# pip install websocket-client
import websocket
import json

api_key = 'your_api_key_here'
ws_url = f'wss://api.tickdb.ai/v1/realtime?api_key={api_key}'

def on_open(ws):
    ws.send(json.dumps({
        'cmd': 'subscribe',
        'data': {
            'channel': 'ticker',
            'symbols': ['XAUUSD', 'EURUSD', 'GBPUSD']
        }
    }))

def on_message(ws, message):
    data = json.loads(message)
    print('Received:', data)

ws = websocket.WebSocketApp(ws_url, on_open=on_open, on_message=on_message)
ws.run_forever()

Full documentation available at API Documentation

Choosing a forex market data API

Distinguish quote streams, executed trades and order books. Bid/ask and spread support currency monitoring but are not centralized-exchange trade data.

Provider Quotes / StreamingScope / DepthAccess / Cost modelBest fit
TickDB Cross-asset market data API
Standard WebSocket quotes and REST queries; forex pairs include bid, ask and spread.
Candles and related commodities; fields vary by instrument. No forex order book or executed-trade feed.
API key, no trading account; REST / WebSocket / Skill / MCP / CLI. Free trial; plan-based access.
Currency alerts, gold correlation, cross-asset dashboards and AI queries.
OANDA API Forex brokerage API
HTTP pricing stream; up to four updates per second per instrument.
Account bid/ask, liquidity tiers and candles; not a centralized forex order book.
v20 account and token; products, regions and fees depend on account services.
OANDA data-and-trading workflows.
Twelve Data Global multi-asset API
WebSocket price streams and REST queries.
Forex and equity time series, indicators, CLI and MCP.
API key; quotas, subscriptions and usage rights vary by plan.
General market apps and multi-asset indicator queries.
Alpha Vantage Query and technical indicator API
Primarily REST currency and time-series queries.
Forex OHLC and technical indicators.
API key; plan-based quotas and real-time entitlements.
Low-frequency forex analysis and prototypes.

Use Cases

Forex Quant Strategies

Tick-by-tick data powering high-frequency strategies with concurrent multi-pair subscriptions.

Corporate FX Risk Management

Real-time exchange rate monitoring for import/export businesses, triggering alerts or hedging when rates hit thresholds.

Triangular Arbitrage

Low-latency synchronized multi-pair quotes to identify triangular arbitrage windows (e.g. EUR/USD → USD/JPY → EUR/JPY).

Choose Your Plan

All paid plans support monthly / quarterly / semi-annual / annual billing. Prices below are annual (20% off)

Free is a 7-day trial for selected instruments, with quotes and permitted bar queries. It does not allow start_time/end_time historical ranges. Depth, trades and specified historical ranges require the appropriate entitlements; check the current plan for symbols and quotas.

🔥 Save 20% Annually

Free

Free 7-Day Trial

 

  • Selected symbols*
  • 5 concurrent subscriptions
  • Real-time quotes
  • Real-time K-line
  • 1 WebSocket connection
  • 30 req/min API calls
  • Email support
Start Free
-20%

Starter

$99/mo
$79 /mo

Billed annually $950

  • All symbols
  • 50 full-market subscriptions
  • Real-time quotes
  • Real-time K-line
  • Real-time order book
  • Real-time trades
  • 1 year historical data
  • 1 WebSocket connection
  • 60 req/min API calls
  • Basic financial data
  • Email support
Subscribe Now
-20%
Most Popular

Professional

$299/mo
$239 /mo

Billed annually $2870

  • All symbols
  • 300 full-market subscriptions
  • Real-time quotes
  • Real-time K-line
  • Real-time order book
  • Real-time trades
  • 3 years historical data
  • 3 WebSocket connections
  • 600 req/min API calls
  • Professional financial data
  • News data
  • Telegram support
Subscribe Now
-20%

Enterprise

$899/mo
$719 /mo

Billed annually $8630

  • All symbols
  • Full-market queries and subscriptions
  • Additional 5000 full-market subscriptions
  • Real-time quotes
  • Real-time K-line
  • Real-time order book
  • Real-time trades
  • 10 years historical data
  • 10 WebSocket connections
  • 1800 req/min API calls
  • Professional financial data
  • News data
  • Telegram support
Subscribe Now

FAQ

Do forex and gold trade around the clock and on weekends?

Forex, gold and silver do not share a universal schedule across instruments and quote sources. Confirm opening, closing, daily maintenance, holidays and daylight saving arrangements for the particular pair or metal with its venue and upstream source. TickDB updates depend on instrument coverage, upstream availability and connection status, not a fixed weekly streaming guarantee.

How many currency pairs does TickDB cover?

1,228 forex instruments, including all major pairs (EUR/USD, GBP/USD, etc.), cross pairs, emerging market pairs, precious metals, and commodities.

What is the latency for forex data?

Forex is TickDB's lowest-latency asset class. WebSocket push latency is typically within 30-50ms.

How does TickDB compare to OANDA?

OANDA fits its trading ecosystem, Twelve Data multi-asset queries and indicators, and Alpha Vantage lower-frequency analysis. TickDB suits account-independent forex and cross-asset dashboards.

Can I query forex and precious metals through the same API?

Yes. EURUSD, gold XAUUSD and silver XAGUSD are documented examples. Precious metals use the forex product type, with ticker subscriptions and bar queries. Accessible instruments depend on your entitlements.

What do bid, ask and spread mean?

When available, bid_price is the best bid, ask_price the best ask and spread the bid/ask spread; timestamp is in milliseconds. These quote fields are not a full order book or a record of executed trades.

How do I query historical bars?

Bars support 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w and 1M: lowercase m means minutes, uppercase M means months. start_time/end_time use milliseconds; the default is 100 bars, capped at 1,000. The last bar may still be forming. Historical access depends on entitlements and availability.

What data is included in the free trial?

Free is a 7-day trial for selected instruments, with quotes and permitted bar queries. It does not allow start_time/end_time historical ranges. Depth, trades and specified historical ranges require the appropriate entitlements; check the current plan for symbols and quotas.

Start Streaming Real-time Market Data

Sign up for a free API Key. WebSocket real-time streaming. Get started in minutes.