Dukascopy APIdukascopy.com ↗
Access historical OHLCV candle data for forex, commodities, indices, stocks, bonds, ETFs, and crypto from Dukascopy. Up to 60-day ranges, multi-period aggregation.
What is the Dukascopy API?
The Dukascopy API exposes 2 endpoints covering historical OHLCV candle data across forex pairs, commodities, indices, stocks, bonds, ETFs, and crypto. The get_candles endpoint returns open, high, low, close, and volume fields with timestamps in both UTC and a configurable local offset, supporting candle periods from 1 to 60 minutes and date ranges up to 60 days per request. The get_instruments endpoint lists all available symbols with metadata including pip value and price scale.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/4bf31981-ccca-4528-a4a4-598f6a88b633/get_instruments' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace dukascopy-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Dukascopy Historical Data — fetch instruments and OHLCV candle data."""
from datetime import datetime, timedelta
from parse_apis.dukascopy_historical_data_feed_api import (
Dukascopy, OfferSide, Period, UpstreamError,
)
client = Dukascopy()
# List available instruments (capped to 5 for brevity).
for inst in client.instruments.list(limit=5):
print(inst.name, inst.description, inst.pip_value)
# Fetch 5-minute BID candles for EUR/USD over a 1-day window.
end = datetime.now().strftime("%Y-%m-%d")
start = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")
for candle in client.candles.list(
instrument="EUR/USD",
offer_side=OfferSide.BID,
period=Period.FIVE,
start_date=start,
end_date=end,
limit=3,
):
print(candle.timestamp_utc, candle.open, candle.close, candle.volume)
# Fetch 1-hour ASK candles for gold.
gold_candle = client.candles.list(
instrument="XAU/USD",
offer_side=OfferSide.ASK,
period=Period.SIXTY,
start_date=start,
end_date=end,
limit=1,
).first()
if gold_candle:
print(gold_candle.timestamp_utc, gold_candle.high, gold_candle.low)
# Typed error handling.
try:
for c in client.candles.list(
instrument="INVALID/PAIR",
start_date=start,
end_date=end,
limit=1,
):
print(c.open)
except UpstreamError as exc:
print(f"upstream error: {exc}")
print("exercised: instruments.list / candles.list (EUR/USD BID 5m, XAU/USD ASK 60m) / UpstreamError catch")
List all available trading instruments with their codes, descriptions, and metadata. Use instrument names/codes from this list as input for the get_candles endpoint.
No input parameters required.
{
"type": "object",
"fields": {
"total": "integer - total number of instruments available",
"instruments": "array of instrument objects with id, name, code, description, group_id, pip_value, price_scale"
},
"sample": {
"data": {
"total": 1501,
"instruments": [
{
"id": 31912,
"code": "0005.HK-HKD",
"name": "0005.HK/HKD",
"group_id": 31,
"pip_value": 0.01,
"description": "HSBC Holdings Plc",
"price_scale": 3
},
{
"id": 30498,
"code": "0027.HK-HKD",
"name": "0027.HK/HKD",
"group_id": 31,
"pip_value": 0.01,
"description": "Galaxy Entertainment Group Ltd",
"price_scale": 3
}
]
},
"status": "success"
}
}About the Dukascopy API
Instruments and Coverage
The get_instruments endpoint returns a full catalog of tradeable symbols available in Dukascopy's market data feed. Each instrument object includes an id, name, code, description, group_id, pip_value, and price_scale. The name field (e.g. EUR/USD, XAU/USD) is the value you pass to get_candles as the instrument parameter. The endpoint takes no inputs and returns the total count alongside the full instruments array.
Candle Data
The get_candles endpoint accepts a start_date and end_date in YYYY-MM-DD format, an instrument in slash format, an offer_side of BID or ASK, a period in minutes (1, 2, 3, 5, 10, 15, 30, or 60), and an optional timezone_offset integer. It returns an array of candle objects, each carrying timestamp_utc, timestamp_eat, open, high, low, close, and volume. The timezone_offset parameter controls the timestamp_eat field and the timezone label in the response (e.g. UTC+3). The response also surfaces instrument in dash format (e.g. EUR-USD), offer_side, period_minutes, total_candles, and an errors array for any days that failed to return data.
Limitations and Behavior
Each get_candles request is bounded to a maximum window of 60 days between start_date and end_date. Requests spanning longer periods require multiple calls. The errors field in the response records per-day failures rather than failing the entire request, so partial results are possible. All underlying data is 1-minute resolution aggregated up to the requested period — periods outside the accepted list (1, 2, 3, 5, 10, 15, 30, 60) are not supported.
The Dukascopy API is a managed, monitored endpoint for dukascopy.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when dukascopy.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official dukascopy.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Backtesting forex trading strategies using bid/ask OHLCV candles for pairs like EUR/USD or GBP/USD
- Building commodity price history charts for gold (XAU/USD) with configurable candle periods
- Aggregating multi-instrument candle data across asset classes for portfolio analysis
- Converting UTC timestamps to local time zones using the timezone_offset parameter for regional trading desks
- Comparing BID vs ASK spread behavior over time by fetching both offer sides for the same instrument
- Populating a backtesting engine with high-resolution 1-minute data for crypto instruments
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.