Documentation

OHLC Endpoint

This is the new v2 documentation: Released in February 2026.

Version v1 will be removed in 31st July 2026. Please see our migration guide to upgrade.

Available on:
Professional

The OHLC endpoint returns OHLC (Open, High, Low, Close) price data for a currency pair on a specific date with various time intervals. This endpoint is designed for technical analysis and charting applications.

OHLC Endpoint

GET /api/v2/ohlc
Available on:
Professional

Request Parameters

key string

Your API key for authentication

quote string

Target currency code (e.g., EUR, GBP, BTC). This is the quote currency in the pair.

date string

Date in YYYY-MM-DD format (e.g., 2026-01-15). Must be in the past (not today or future) and within the last 30 days. Dates older than 30 days will return error 424.

base string

Base currency code (e.g., USD, EUR). Defaults to USD.

Default: USD

interval string

Time interval for OHLC. Allowed values: 5m, 15m, 30m, 1h, 4h, 12h, 1d

Default: 1d

output string

Response output format. Use `json` (default) or `xml`

Default: json

Response Properties

valid boolean

Indicates whether the request was successful

base string

Base currency code used for the pair

quote string

Target currency code (the quote parameter)

date string

Date for which candle data is returned (YYYY-MM-DD format)

interval string

Time interval used for the OHLC data

ohlc array

Array of OHLC objects for the requested date and interval

start string

ISO 8601 timestamp for the start of the candle period

open number

Opening price for the period

high number

Highest price during the period

low number

Lowest price during the period

close number

Closing price for the period

Interval Options

The OHLC endpoint supports multiple time intervals to suit different analysis needs:

  • 5m: 5-minute OHLC - for intraday trading and short-term analysis
  • 15m: 15-minute OHLC - for short-term trend analysis
  • 30m: 30-minute OHLC - for medium-term intraday analysis
  • 1h: 1-hour OHLC - for hourly price movements
  • 4h: 4-hour OHLC - for longer intraday periods
  • 12h: 12-hour OHLC - for half-day analysis
  • 1d: 1-day OHLC (default) - for daily price movements and long-term analysis

Choose the interval that best matches your analysis timeframe. Shorter intervals provide more granular data but require more requests to cover longer periods.

Common Use Cases

The OHLC endpoint is commonly used for:

  • Trading platforms: Build OHLC charts for forex and cryptocurrency trading
  • Technical analysis: Calculate indicators like moving averages, RSI, MACD, and Bollinger Bands
  • Financial dashboards: Display price movements and volatility metrics
  • Backtesting: Test trading strategies using historical OHLC data
  • Market research: Analyze price patterns and trends over time
  • Risk management: Calculate price ranges and volatility for risk assessment

Best Practices

To optimize your use of the OHLC endpoint:

  • Choose appropriate intervals: Match the interval to your analysis timeframe to minimize API calls
  • Cache candle data: OHLC data doesn't change once the period ends, so cache it permanently
  • Handle missing data: Some dates or intervals may not have data available - always check the response
  • Use date validation: Ensure dates are in the past, in the correct YYYY-MM-DD format, and within the last 30 days (inclusive). Dates older than 30 days will return error 424.
  • Validate currency codes: Ensure both base and quote parameters use valid currency codes
  • Monitor rate limits: Professional plan has higher limits, but still monitor your usage