Response Formats

CSV and JSON OHLC API Formats

Choose JSON for applications and pandas, or CSV for Excel, MT5 and quick inspection. Both return the same OHLC bars and the same broker-server timestamps.

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

2response formats
7OHLC fields
617datasets
9timeframes

JSON response shape

JSON is the default. The top-level object contains request metadata and a data array. Each array item is one OHLC bar.

KeyTypeDescription
symbolstringDisplay symbol, such as XAUUSD
timeframestringM1, M5, M15, M30, H1, H4, D1, W1 or MN1
from, tostringRequested date range
rowsintegerNumber of bars in data
dataarrayBar objects with Timestamp, Open, High, Low, Close, TickVolume and Spread

CSV response

Add format=csv to receive a header row followed by one row per bar. The CSV header is:

Timestamp,Open,High,Low,Close,TickVolume,Spread

The timestamp uses YYYY.MM.DD HH:MM:SS in broker server time. Prices are numeric. TickVolume and Spread are integers and may be 0 on legacy forex feeds.

Which format should you use?

JSON

Best for Python, JavaScript, APIs and applications that need named fields.

CSV

Best for Excel, MT5 import, SQL bulk loading and quick visual inspection.

Parquet

Not returned by the HTTP API. Use the builder for Parquet downloads.

Format notes and limitations

  • JSON and CSV contain the same rows; the format does not change the data.
  • Timestamps are broker server time, not UTC.
  • Some legacy datasets have no tick volume or spread; those fields return 0.
  • The HTTP API does not return Parquet. Parquet is available through the download builder.
  • A response is capped at 50,000 rows and a 366-day range.

Request examples

JSON request

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

CSV request

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

Read CSV with pandas

import pandas as pd

url = "https://www.algospecial.com/api/ohlc.php"
params = {
    "symbol": "XAUUSD",
    "tf": "M15",
    "from": "2026-01-01",
    "to": "2026-01-31",
    "format": "csv",
}
df = pd.read_csv(url, params=params)
df["Timestamp"] = pd.to_datetime(df["Timestamp"])
print(df.head())

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.

CSV & JSON FAQ

What is the default response format?

JSON. Add format=csv for CSV.

Do JSON and CSV contain the same data?

Yes. The format changes only the representation, not the OHLC rows.

What timestamp format is used?

YYYY.MM.DD HH:MM:SS in broker server time.

Can the API return Parquet?

No. Parquet is available through the historical data builder, not the HTTP API.

Why are TickVolume and Spread zero?

Some legacy source feeds do not include volume or spread history. The API returns 0 instead of inventing values.

🚀 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. ×