Leo4815162342 /dukascopy-node

✨ Download historical and real-time price tick data for Crypto, Stocks, ETFs, CFDs, Forex via CLI and Node.js ✨

★ 994⑂ 148👁 11⑃ 145● 104▤ 54
TypeScriptMITCreated 2019-06-08dukascopy-node.app
下载:v1.51.1v1.51.1 ↓1.51.12026-10-28
+2
日增长
994
stars
148
forks
11
watchers
145
prs
104
issues
54
releases

README

dukascopy-node




    ✨ Download free historical and real-time market price tick data ✨ Stocks • Crypto • Commodities • Bonds • Currencies • CFDs • ETFs   via Node.js and CLI



    
    
    
    

📚 Documentation
 MCP Docs (via Context7 MCP)





 🚀 Installation


    
        
             npm
             yarn
             pnpm
        
    
    
        
            npm install dukascopy-node --save
            yarn add dukascopy-node
            pnpm add dukascopy-node
        
    


 [!IMPORTANT]  
 Node.js 20 or higher is required.

 Browser setup

Downloads may require Chromium or Google Chrome. If Chrome is not installed,
install Chromium once on Windows, macOS, or Linux:

sh
npx dukascopy-node --install-browser


For a project with the package already installed, use
npx dukascopy-node --install-browser. On Linux, add --with-deps to install
required system libraries. Run setup again if an upgrade asks for a newer browser.
The browser runs in the background.

 HTTP 403 and browser challenges

An explicit AWS WAF challenge can start browser recovery. A 403 without a
challenge stops the download: no further requests, ordinary retries, or browser
recovery start for it. With the default failAfterRetryCount: true, it raises
DukascopyAccessDeniedError (code: 'DUKASCOPY_ACCESS_DENIED', status: 403,
url, and source, which is 'browser' when the headless browser was refused).
Cached tokens are kept, because a plain 403 does not show that a token is invalid.
The next getHistoricalRates call or CLI run starts fresh.

If this happens, check that Dukascopy's
historical data export page
works in a regular browser, and update dukascopy-node. Reinstalling Chromium or
deleting the token cache does not help with a plain 403. See
issue 264.

 ✨ Download Historical Price Data via CLI

bash
npx dukascopy-node -i btcusd -from 2019-01-13 -to 2019-01-14 -t tick -f csv


!dukascopy-node-1080p


🛠️ View full CLI specification

---

 ✨ Download Historical Price Data via Node.js

javascript
const { getHistoricalRates } = require('dukascopy-node');

(async () = {
  try {
    const data = await getHistoricalRates({
      instrument: 'btcusd',
      dates: {
        from: new Date('2019-01-13'),
        to: new Date('2019-01-14')
      },
      timeframe: 'tick',
      format: 'json'
    });

    console.log(data);
  } catch (error) {
    console.log('error', error);
  }
})();


🛠️ View full Node.js specification

 ✨ Download Real-Time Price Data via Node.js 

javascript
const { getRealTimeRates } = require('dukascopy-node');

(async () = {
  try {
    const data = await getRealTimeRates({
      instrument: 'eurusd',
      timeframe: 'tick',
      format: 'json'
    });

    console.log(data);
  } catch (error) {
    console.log('error', error);
  }
})();


ℹ️ More Information

---

 📖 Quick start
 Basic usage of dukascopy-node
 Downloading tick data
 Date formatting and converting timezones
 Dealing with empty data and errors
 Downloading data with cache
 Downloadin

Top issues

Discussions

Latest release

v1.51.1 v1.51.1 2026-10-28
What's Changed
 fix: stop retries and browser recovery after plain HTTP 403 by @neodix42 in https://github.com/Leo4815162342/dukascopy-node/pull/265
 fix: send export widget headers and tighten 403 handling by @Leo4815162342 in https://github.com/Leo4815162342/dukascopy-node/pull/266

 New Contributors
 @neodix42 made their first contribution in https://github.com/Leo4815162342/dukascopy-node/pull/265

Full Changelog: https://github.com/Leo4815162342/dukascopy-node/compare/v1.51.0...v1.51.1

Snapshot: 2026-11-28T10:06:57Z · Data license Apache-2.0 · JSON