Skip to main content

A simple wrapper for capital.com exchange API

Project description

Welcome to python-capital v0.2.0

Updated 19th Dec 2025

This is an unofficial Python wrapper for the Capital.com Public API v1.
I am in no way affiliated with Capital.com, use at your own risk.

If you came here looking for the Capital.com exchange to invest in CFDs, then go here.
If you want to automate interactions with Capital.com, stick around.

Source code:
https://github.com/

Features

  • Simple handling of authentication
  • Password encryption end-to-end
  • Response exception handling
  • Positions opening/closing
  • Market prices and sentiment

Quick Start

Register an account with Capital.com.

Generate an API Key.

To use the Demo accounts, pass demo=True when creating the client (default is set to False).

pip install python-capital.com
from capital.client import Client

client = Client(username, api_key, api_password)

# get all open positions
positions = client.all_positions()

# to create a position
order = client.create_position(epic, direction, size)

# to close a position
close = client.close_position(deal_id)

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_capital-0.2.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_capital-0.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file python_capital-0.2.0.tar.gz.

File metadata

  • Download URL: python_capital-0.2.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_capital-0.2.0.tar.gz
Algorithm Hash digest
SHA256 982d3d8ccb0966c7a5e2990a177ae11ed4e83bfef9ab9e116d23f497c0a98494
MD5 85300f098aa656906e087fa5a7696694
BLAKE2b-256 d5dd01dbb3ba28ef613651657b7bb5fc514bbc6fe6a31695a260ff4688183637

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_capital-0.2.0.tar.gz:

Publisher: publish.yml on iribeirocampos/python-capital

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_capital-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: python_capital-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_capital-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78fb5cd5b0878c8f771715b754f550f95af5b72c07096889bd4ecc1ecd5072af
MD5 191674d07cab63852cc5194109738cd5
BLAKE2b-256 d3f86b9fc15cdf440425f1a25fc952aae99cca13795219307501a75785824917

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_capital-0.2.0-py3-none-any.whl:

Publisher: publish.yml on iribeirocampos/python-capital

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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