Python Wrapper for Interactive Brokers API
Project description
“Logo for ‘IBCP’”
Overview
Please see https://ibcp.readthedocs.io for the full documentation.
Features
Simple REST API wrapper
Easy to use and understand
Supports all Interactive Brokers Client Portal Web API endpoints
Handles authentication and session management
Supports both SSL and non-SSL connections
Requirements
IBCP assumes a gateway session is active and authenticated.
Installation
IBCP was developed under the Voyz/IBeam docker image environment.
Once a gateway session is running, pip command can be used to install IBCP:
pip install ibcp
Usage
import ibcp
ib = ibcp.REST() # default parameters: url="https://localhost:5000", ssl=False
# Get account information
account = ib.get_account()
# Get portfolio
portfolio = ib.get_portfolio()
# Get positions
positions = ib.get_positions()
# Get orders
orders = ib.get_orders()
# Get trades
trades = ib.get_trades()
# Get market data
market_data = ib.get_market_data("AAPL")
# Place order
order = ib.place_order({
"symbol": "AAPL",
"secType": "STK",
"currency": "USD",
"exchange": "SMART",
"tif": "DAY",
"side": "BUY",
"totalQuantity": 100,
"orderType": "MKT"
})
For the complete reference, please visit https://ibcp.readthedocs.io/en/latest/reference.html.
Configuration
By default, IBCP assumes the gateway session is open at https://localhost:5000 without an SSL certificate. A custom URL and SSL certificate can be set by:
ib = ibcp.REST(url="https://localhost:5000", ssl=False)
Documentation of available functions is at https://ibcp.readthedocs.io/en/latest/reference.html.
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 ibcp-0.0.3.tar.gz.
File metadata
- Download URL: ibcp-0.0.3.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b23291976f253aff9cffb065befbcad4c9b8909f9283b07bdf807a5e049d847
|
|
| MD5 |
48d8145c8128d87d96dc8bf80aaec3ce
|
|
| BLAKE2b-256 |
8f5afaf0e40e170f2cc1eff2c54157916f6da6356f80119ad555e8224a7c721f
|
Provenance
The following attestation bundles were made for ibcp-0.0.3.tar.gz:
Publisher:
python-publish.yml on matthewmoorcroft/ibcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibcp-0.0.3.tar.gz -
Subject digest:
8b23291976f253aff9cffb065befbcad4c9b8909f9283b07bdf807a5e049d847 - Sigstore transparency entry: 455830772
- Sigstore integration time:
-
Permalink:
matthewmoorcroft/ibcp@a306ec7a07a2ee8fb9a6cfe336ebb7eb399387f4 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/matthewmoorcroft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a306ec7a07a2ee8fb9a6cfe336ebb7eb399387f4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ibcp-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ibcp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0916127cd9f0edf1b9b32702272982aabc35280fd7a9423d509446a69d4a3f46
|
|
| MD5 |
5ac1075b45546d6b60fd89b5a591fbf2
|
|
| BLAKE2b-256 |
914ba87dfc98958263be4fdd4c7aa4924da46b4ad91d83bfb30660dc9de9b33e
|
Provenance
The following attestation bundles were made for ibcp-0.0.3-py3-none-any.whl:
Publisher:
python-publish.yml on matthewmoorcroft/ibcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibcp-0.0.3-py3-none-any.whl -
Subject digest:
0916127cd9f0edf1b9b32702272982aabc35280fd7a9423d509446a69d4a3f46 - Sigstore transparency entry: 455830792
- Sigstore integration time:
-
Permalink:
matthewmoorcroft/ibcp@a306ec7a07a2ee8fb9a6cfe336ebb7eb399387f4 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/matthewmoorcroft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a306ec7a07a2ee8fb9a6cfe336ebb7eb399387f4 -
Trigger Event:
release
-
Statement type: