Skip to main content

An unofficial client for the official Trading212 API

Project description

python-trading212

CICD Status PyPI - Downloads GitHub License PyPI - Python Version PyPI - Version

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

python_trading212-2.0.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

python_trading212-2.0.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for python_trading212-2.0.3.tar.gz
Algorithm Hash digest
SHA256 72d2bd70282f2bbd5641c5bcde20e1fc15c5e3d98b0b18836500bfb040ec7024
MD5 76e0ad35eda45023d78e6accc275e7e1
BLAKE2b-256 b69b6651c16839f7e980b127b664d694fdea29b50f269764031ce723be13aa77

See more details on using hashes here.

File details

Details for the file python_trading212-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_trading212-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 52b191bbe97472f7888166aa3824e1eabe5b17ef334c2bafe9253f68c9b65f13
MD5 8ec81ae849d98a762b7b5f9e094a0666
BLAKE2b-256 b9015f619cbe5db4ab6740628fe264996e2883d751f7a4c67b1f69c0257ad196

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page