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.
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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
982d3d8ccb0966c7a5e2990a177ae11ed4e83bfef9ab9e116d23f497c0a98494
|
|
| MD5 |
85300f098aa656906e087fa5a7696694
|
|
| BLAKE2b-256 |
d5dd01dbb3ba28ef613651657b7bb5fc514bbc6fe6a31695a260ff4688183637
|
Provenance
The following attestation bundles were made for python_capital-0.2.0.tar.gz:
Publisher:
publish.yml on iribeirocampos/python-capital
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_capital-0.2.0.tar.gz -
Subject digest:
982d3d8ccb0966c7a5e2990a177ae11ed4e83bfef9ab9e116d23f497c0a98494 - Sigstore transparency entry: 774181598
- Sigstore integration time:
-
Permalink:
iribeirocampos/python-capital@0e412dc2775bdca69a339fb59b5cd7eead8a5bce -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/iribeirocampos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e412dc2775bdca69a339fb59b5cd7eead8a5bce -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78fb5cd5b0878c8f771715b754f550f95af5b72c07096889bd4ecc1ecd5072af
|
|
| MD5 |
191674d07cab63852cc5194109738cd5
|
|
| BLAKE2b-256 |
d3f86b9fc15cdf440425f1a25fc952aae99cca13795219307501a75785824917
|
Provenance
The following attestation bundles were made for python_capital-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on iribeirocampos/python-capital
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_capital-0.2.0-py3-none-any.whl -
Subject digest:
78fb5cd5b0878c8f771715b754f550f95af5b72c07096889bd4ecc1ecd5072af - Sigstore transparency entry: 774181600
- Sigstore integration time:
-
Permalink:
iribeirocampos/python-capital@0e412dc2775bdca69a339fb59b5cd7eead8a5bce -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/iribeirocampos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e412dc2775bdca69a339fb59b5cd7eead8a5bce -
Trigger Event:
release
-
Statement type: