Automate retrieval of Trading 212 dividend payments.
- Node.js (>=
v14.14.0
) - Yarn
I've created stock-bot-api to retrieve dividend yield information, which I intend to host somewhere in the future, but for now you can download and run it locally. It's not exactly a requirement, but this app will show warnings when trying to generate the dashboard data without it.
- Install dependencies:
yarn install
- Set your Trading 212 username and password in the config
- Run
yarn data:fetch
A Chrome browser will be started via Puppeteer, trading212.com will be loaded and your username/password will be filled out. You'll be asked to input a 2FA code if it has been enabled on your account.
The app then captures the required tokens to call different endpoints on trading212.com and a JSON file is created in ./src/api-response/dividends.json
with the history of your dividend payments.
To view a dashboard of your results, run yarn start:fresh
.