{"id":51590323,"url":"https://github.com/bentimor/trading212api","last_synced_at":"2026-07-11T14:00:40.946Z","repository":{"id":52591335,"uuid":"286790287","full_name":"BenTimor/Trading212API","owner":"BenTimor","description":"An unofficial API for Trading212","archived":false,"fork":false,"pushed_at":"2021-04-24T12:11:01.000Z","size":26,"stargazers_count":54,"open_issues_count":0,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-02-25T23:20:22.828Z","etag":null,"topics":["python","python3","selenium","stocks","trading","trading-algorithms","trading-bot","trading212","unofficial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenTimor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-11T16:10:59.000Z","updated_at":"2025-10-29T23:46:06.000Z","dependencies_parsed_at":"2022-09-26T20:22:16.326Z","dependency_job_id":null,"html_url":"https://github.com/BenTimor/Trading212API","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/BenTimor/Trading212API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FTrading212API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FTrading212API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FTrading212API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FTrading212API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenTimor","download_url":"https://codeload.github.com/BenTimor/Trading212API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FTrading212API/sbom","scorecard":{"id":21053,"data":{"date":"2025-08-11","repo":{"name":"github.com/BenTimor/Trading212API","commit":"7b30ce6a7fce95d15e480d1928017a4bf67dfc72"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/13 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T16:48:47.268Z","repository_id":52591335,"created_at":"2025-08-14T16:48:47.268Z","updated_at":"2025-08-14T16:48:47.268Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35364269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","python3","selenium","stocks","trading","trading-algorithms","trading-bot","trading212","unofficial"],"created_at":"2026-07-11T14:00:25.401Z","updated_at":"2026-07-11T14:00:40.933Z","avatar_url":"https://github.com/BenTimor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trading212 API\n\n### Right now the API is not always working properly. I don't have enough time to fix it, But everyone is more than welcome to contribute and I'll check all of the PRs.\n\nThis is an **unofficial** selenium based API for 'Trading212' broker. \n**Neither me and neither Trading212 are responsible for the API, You are responsible for your actions and for using the API.**\n\nAdditionally, Note the Trading212 ['Robo Trading' agreement](https://www.trading212.com/en/robo-trading-agreement).\n\nThe API is still WIP, I don't know if and how it's going to work on your computer. But you're more than welcome to open and issue and I'll try to help as much as I can.\n\n## Requirements\n- Python 3.x\n- Selenium package\n- GeckoDriver\n- FireFox browser\n\n## Installation\n`pip install trading212`\n\n## Import\nCFD mode:\n\n````\nfrom Trading212 import CFD\n\ntrading = CFD(email, password) # For practice\ntrading = CFD(email, password, panel=Panel.Real) # For real money\n\n````\n\nInvest mode:\n\n````\nfrom Trading212 import Invest\n\ntrading = Invest(email, password) # For practice\ntrading = Invest(email, password, panel=Panel.Real) # For real money\n\n````\n\n## Usage\nFirst of all, You have to know that the API currently uses the **display name** of the stocks.\n\n#### Buying a stock ('Long')\n`trading.buy_stock(stock, amount)`\n\n#### Selling a stock ('Short')\n`trading.sell_stock(stock, amount) # Available for CFD only`\n\n#### Closing a position\n`trading.close_position(stock)`\n\n#### Getting a result of a position\n`trading.result(stock)`\n\n#### Getting another information of a position\n`trading.position_info(css_class)`\n\nYou can get anything that's written in the bar. I've added a picture with source code so you'll be able to select the class.\n\n![Classes](https://i.imgur.com/K05pRqs.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentimor%2Ftrading212api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentimor%2Ftrading212api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentimor%2Ftrading212api/lists"}