Skip to content

0xnu/trading212

Trading212

Test Release Go Report Card Go Reference License

An unofficial Go library for interacting with the Trading212 API.

Warning

Disclaimer: Using the Trading212 Golang library to create trading bots involves risks, including potential losses from market volatility and reliance on historical price patterns that may not predict future movements. External factors like news events and economic changes can also affect the bot's performance, so only invest money you can afford to lose.

Generating API Key

Create an API key for Trading212 by following these steps:

  • Click the hamburger menu after logging into your Trading212 account
  • Scroll to the bottom
  • Click the green button "Switch to Practice"
  • Click Settings
  • Click "API (Beta)"
  • Click "Generate API key"

Tests

Execute this command: make test

Demo

  • Update the API Key with your own inside here
  • Execute this command: make run

Single Stock Trading

  • Update the API Key with your own inside here
  • Execute this command: make trade

Multi-Stock Trading

  • Update the API Key with your own inside here
  • Execute this command: make multistock

Using the Trading212 API

You can read the API documentation to understand what's possible with the Trading212 API.

License

This project is licensed under the MIT License.

Copyright

(c) 2025 Finbarrs Oketunji. All Rights Reserved.

About

An unofficial Go library for interacting with the Trading212 API.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published