Installation
Install dukascopy-node with npm, pnpm or yarn, then run the CLI once to check that everything works.
Install the package
Section titled “Install the package”Add dukascopy-node to your project. The package includes both the Node.js library and the CLI:
npm
pnpm
yarn
npm install dukascopy-nodepnpm add dukascopy-nodeyarn add dukascopy-nodeIt needs Node.js 20 or later; check your version with node --version. TypeScript types are included, so there is no separate @types package to install.
Check the setup
Section titled “Check the setup”From your project folder, download a day of hourly EUR/USD candles with the CLI:
npm
pnpm
yarn
npx dukascopy-node -i eurusd -from 2024-01-02 -to 2024-01-03 -t h1 -f csvpnpm exec dukascopy-node -i eurusd -from 2024-01-02 -to 2024-01-03 -t h1 -f csvyarn dukascopy-node -i eurusd -from 2024-01-02 -to 2024-01-03 -t h1 -f csvIf the CLI ends with √ File saved: download/eurusd-h1-bid-2024-01-02-2024-01-03.csv and the file size, you are ready to go. See the CLI reference for every option.