An unofficial client for the official Trading212 API
Project description
python-trading212
A client for the Trading212 API
Installation
pip install python-trading212
Usage
Set your API key in the environment variable:
export TRADING_212_KEY=<your-api-key>
from trading212 import Trading212, Pie
trading212 = Trading212()
pie: Pie = trading212.fetch_pie(123)
positions: List[Position] = trading212.fetch_all_open_positions()
trading212.create_pie(
Pie(
name='My Pie',
...
)
)
Supported Endpoints
Instruments Metadata
- Exchange List
- Instrument List
Pies
- Fetch all pies
- Create Pie
- Delete Pie
- Fetch a Pie
- Update pie
Equity Orders
- Fetch all
- Place Limit order
- Place Market order
- Place Stop order
- Place StopLimit order
- Cancel by ID
- Fetch by ID
Account Data
- Fetch account cash
- Fetch account metadata
Personal Portfolio
- Fetch all open positions
- Fetch a specific position
Historical Items
- Historical order data
- Paid out dividens
- Exports List
- Export csv
- Transaction list
Disclaimer
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_trading212-2.0.3.tar.gz
.
File metadata
- Download URL: python_trading212-2.0.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72d2bd70282f2bbd5641c5bcde20e1fc15c5e3d98b0b18836500bfb040ec7024 |
|
MD5 | 76e0ad35eda45023d78e6accc275e7e1 |
|
BLAKE2b-256 | b69b6651c16839f7e980b127b664d694fdea29b50f269764031ce723be13aa77 |
File details
Details for the file python_trading212-2.0.3-py3-none-any.whl
.
File metadata
- Download URL: python_trading212-2.0.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52b191bbe97472f7888166aa3824e1eabe5b17ef334c2bafe9253f68c9b65f13 |
|
MD5 | 8ec81ae849d98a762b7b5f9e094a0666 |
|
BLAKE2b-256 | b9015f619cbe5db4ab6740628fe264996e2883d751f7a4c67b1f69c0257ad196 |