Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to python-capital

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)

About

Simple wrapper for Capital.com API

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages