# Dukascopy Historical Price API (`pepeschuster/dukascopy-price-api`) Actor

Historical daily OHLCV for any Dukascopy instrument (FX, metals, commodities, indices) over any date range, from Dukascopy's public feed. No login, no proxies. Returns all available data even when the requested range exceeds coverage.

- **URL**: https://apify.com/pepeschuster/dukascopy-price-api.md
- **Developed by:** [Pepe Schuster](https://apify.com/pepeschuster) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.20 / 1,000 price bars

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Dukascopy Historical Price API

**Historical daily OHLCV for any Dukascopy instrument — FX, metals, commodities, and indices — over any date range, straight from Dukascopy's public feed. No login, no API key, no proxies.**

Getting clean historical price history usually means a $100–$500 dataset or a paid data terminal. This Actor gives you the same thing **pay-as-you-go**: pass a list of instruments and a date range, and get back tidy daily **open / high / low / close / volume** bars you can download as JSON, CSV, or Excel — or pull straight from the API.

### Features

- 🌍 **Any asset class** — FX pairs (EURUSD, GBPUSD, USDJPY…), metals (XAUUSD gold, XAGUSD silver), commodities (LIGHTCMDUSD WTI, COPPERCMDUSD), and indices (USA500IDXUSD, DEUIDXEUR DAX…).
- 📅 **Any date range** — decades of history in a single run.
- 🛡️ **Graceful by design** — ask for a range wider than the data goes back, and you get **all the data that exists** plus a clear log of coverage — never a hard error or an empty crash.
- 🎯 **Correctly scaled prices** — per-instrument decimal handling, so gold reads ~2000 and EURUSD reads ~1.08, out of the box.
- 💾 **Any format** — JSON, CSV, Excel, or the dataset API; schedule it for a rolling update.

### Who it's for

Quant researchers and algo traders (backtesting), fintech builders and dashboards, analysts, and anyone who needs affordable, structured price history without a data-vendor contract.

### Input

| Field | Type | Description |
|---|---|---|
| `instruments` | array | Dukascopy instrument codes, e.g. `EURUSD`, `XAUUSD`, `LIGHTCMDUSD`, `USA500IDXUSD`. **Required.** |
| `fromDate` | string | Start date, `YYYY-MM-DD`. |
| `toDate` | string | End date, `YYYY-MM-DD` (default: today). |
| `priceType` | string | `bid` (default) or `ask`. |
| `decimalFactor` | integer | Advanced: override the price scale for an unlisted instrument. Leave empty otherwise. |

**Example input**

```json
{
  "instruments": ["EURUSD", "XAUUSD"],
  "fromDate": "2015-01-01",
  "toDate": "2023-12-31",
  "priceType": "bid"
}
```

### Output

One record per instrument per trading day:

```json
{
  "instrument": "EURUSD",
  "date": "2023-01-02",
  "open": 1.07007,
  "high": 1.07087,
  "low": 1.06499,
  "close": 1.06765,
  "volume": 132616.06
}
```

### Pricing

**Pay-per-result** — billed per daily bar returned. A full decade of one instrument is roughly **2,600 bars**, so you pay cents where a historical dataset would cost hundreds of dollars. No subscription, and out-of-range requests that return nothing cost nothing.

### FAQ

**Do I need a Dukascopy account or key?** No — it reads Dukascopy's public data feed.
**What if I request dates before the data starts?** You get everything that exists for that instrument; the Actor never errors on an out-of-range request.
**Which instruments are supported?** Any Dukascopy instrument code. Common ones (FX, metals, WTI, copper, major indices) are scaled automatically; for an exotic one, set `decimalFactor` if the price looks off.
**Can I schedule it?** Yes — run it daily/weekly to keep a rolling price history up to date.
**Bid or ask?** Either — set `priceType`.

### Notes

Prices are Dukascopy's public spot/CFD feed (not exchange settlement data). Please use responsibly and within Dukascopy's terms of service.

# Actor input Schema

## `instruments` (type: `array`):

Dukascopy instrument codes. FX (EURUSD, GBPUSD, USDJPY), metals (XAUUSD, XAGUSD), commodities (LIGHTCMDUSD=WTI, COPPERCMDUSD), indices (USA500IDXUSD, DEUIDXEUR).

## `fromDate` (type: `string`):

Start date, YYYY-MM-DD.

## `toDate` (type: `string`):

End date, YYYY-MM-DD. Default: today.

## `priceType` (type: `string`):

Which price side to return — bid (default) or ask.

## `decimalFactor` (type: `integer`):

Only for an unlisted instrument whose price looks off. Leave empty for known instruments.

## Actor input object example

```json
{
  "instruments": [
    "EURUSD",
    "GBPUSD",
    "XAUUSD"
  ],
  "fromDate": "2020-01-01",
  "priceType": "bid"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "instruments": [
        "EURUSD",
        "XAUUSD"
    ],
    "fromDate": "2020-01-01"
};

// Run the Actor and wait for it to finish
const run = await client.actor("pepeschuster/dukascopy-price-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "instruments": [
        "EURUSD",
        "XAUUSD",
    ],
    "fromDate": "2020-01-01",
}

# Run the Actor and wait for it to finish
run = client.actor("pepeschuster/dukascopy-price-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "instruments": [
    "EURUSD",
    "XAUUSD"
  ],
  "fromDate": "2020-01-01"
}' |
apify call pepeschuster/dukascopy-price-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pepeschuster/dukascopy-price-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/o8sJ2endUJaTPWpC1/builds/cA9iYSlTmjQKAHAAY/openapi.json
