Gold Data API

Free XAUUSD Historical Data API

Query XAUUSD and XAUAUD gold bars from M1 to MN1 with a simple JSON or CSV request. Built for gold backtests, MT5 data validation, session research and machine-learning datasets.

Updated 2026-11-02 ? Data refreshed from the AlgoSpecial catalog.

9XAUUSD datasets
1.8Mgold OHLC rows
9timeframes
97 AXAUUSD M15 quality score

XAUUSD coverage and timeframes

The API serves gold datasets for XAUUSD and XAUAUD. XAUUSD is the primary feed, with intraday and higher-timeframe history suitable for gold scalping tests, swing models and multi-timeframe filters.

TimeframeTypical useAPI value
M1Execution research and tick-sensitive gold strategiesM1
M5 / M15 / M30Intraday gold systems and session filtersM5, M15, M30
H1 / H4Swing models and higher-timeframe biasH1, H4
D1 / W1 / MN1Long-horizon research and regime studiesD1, W1, MN1

The XAUUSD M15 dataset contains 225,077 bars from 2017-01-19 to 2026-10-30. Other timeframes have different start dates and row counts. Use the data builder to inspect exact coverage before downloading a large file.

Request XAUUSD OHLC data

The OHLC endpoint accepts a symbol, timeframe, date range and optional format. The date range is inclusive and limited to 366 days per request. JSON is the default; add format=csv for a spreadsheet-friendly response.

FieldMeaning
TimestampBroker server time in YYYY.MM.DD HH:MM:SS format
Open, High, Low, CloseOHLC prices for the bar
TickVolumeTick count where the source feed provides it
SpreadSpread in broker points where available

XAUUSD is quoted with three decimals on the Exness-style source feed. The API returns the stored prices without rewriting them for another broker's digits.

Gold data quality

The XAUUSD M15 report scores 97.0 / 100 and receives an A grade. The audit checks duplicate timestamps, OHLC violations, non-positive prices, flat bars, zero volume, zero spread, extreme returns, gaps and weekend bars.

  • No duplicate timestamps or OHLC violations in the M15 audit.
  • Small numbers of flat bars and zero-spread bars are reported as warnings, not hidden.
  • Expected market-closure gaps remain visible so you can decide how to handle weekends and holidays.

Open the full XAUUSD M15 quality report or query the Data Quality API before using a dataset in production.

Common XAUUSD API use cases

Gold EA backtesting

Feed M1 or M15 gold bars into an MT5 strategy tester or an external backtest engine.

Session analysis

Compare Asia, London and New York gold behaviour with broker-server timestamps.

Machine learning

Build returns, volatility and range features from a consistent OHLC history.

Limits, timezone and best practice

Anonymous access is limited to 60 requests per minute and 1,000 requests per day per IP. A single request can return up to 50,000 rows and cover at most 366 days. For a multi-year M1 study, split the date range into smaller windows and cache each response.

Timestamps are broker server time, not UTC. Convert them explicitly if your model uses New York or London session boundaries. When a request is too large, the API returns 413 with a clear error instead of silently truncating the dataset.

Request examples

cURL - XAUUSD M15 JSON

curl "https://www.algospecial.com/api/ohlc.php?symbol=XAUUSD&tf=M15&from=2026-01-01&to=2026-01-31&format=json"

Python - load gold bars into pandas

import pandas as pd
import requests

url = "https://www.algospecial.com/api/ohlc.php"
params = {
    "symbol": "XAUUSD",
    "tf": "M15",
    "from": "2026-01-01",
    "to": "2026-01-31",
}
response = requests.get(url, params=params, timeout=30)
response.raise_for_status()
df = pd.DataFrame(response.json()["data"])
df["Timestamp"] = pd.to_datetime(df["Timestamp"])
print(df.head())

cURL - XAUUSD CSV

curl "https://www.algospecial.com/api/ohlc.php?symbol=XAUUSD&tf=H1&from=2026-01-01&to=2026-03-31&format=csv" -o XAUUSD_H1.csv

All timestamps are broker server time. Some legacy forex exports return 0 for TickVolume and Spread because those fields were not present in the source feed.

XAUUSD API FAQ

Is the XAUUSD API free?

Yes. It is free with a per-IP limit of 60 requests per minute and 1,000 requests per day.

How far back does XAUUSD history go?

The XAUUSD M15 dataset starts on 2017-01-19 and runs to 2026-10-30. Other timeframes have different coverage, so check the dataset builder or quality report.

Can I download XAUUSD as CSV?

Yes. Add format=csv to the OHLC request. The CSV uses the same Timestamp, Open, High, Low, Close, TickVolume and Spread columns.

Does the API include XAUUSD volume?

TickVolume is returned where the source feed provides it. Some legacy feeds do not include volume or spread; those fields return 0.

What timezone are gold timestamps in?

Timestamps are broker server time. Convert to UTC or New York time if your strategy uses session boundaries.

🚀 Invite friends — Earn $5 You both get $5 credit on Go Ad · opencode.ai AI-Powered Coding Agent — Try Free Build apps, fix bugs & ship faster with opencode. Get $5 free credit when you join. × Ad · quo.com QuoPhone — $20 Visa Gift Card Free Sign up to Quo, subscribe 3 months, get a $20 Visa gift card. Atif's referral gift for you. ×