Python wrapper for Interactive Brokers Client Portal Web API

Overview

EasyIB: Unofficial Wrapper for Interactive Brokers API

https://img.shields.io/pypi/v/easyib https://img.shields.io/pypi/pyversions/easyib https://img.shields.io/pypi/l/easyib Documentation Status

EasyIB is an unofficial python wrapper for Interactive Brokers Client Portal Web API.

Features

Notable functionality includes:

  • Pull account info, portfolio, cash balance, net value
  • Pull market historical data
  • Submit, modify, cancel orders
  • Get order status, list of live orders
  • Ping (tickle) server, get authentication status, re-authenticate

How to install

pip install easyib

EasyIB assumes a gateway session is active and authenticated. Follow instructions at https://interactivebrokers.github.io/cpwebapi/ for authentication. A custom package such as Voyz/IBeam can be also used for setting up an active session.

Quick start

Historical data

import easyib

api = easyib.REST()

bars = api.get_bars("AAPL", period="1w", bar="1d")
print(bars)

Submitting an order

list_of_orders = [
    {
        "conid": api.get_conid("AAPL"),
        "orderType": "MKT",
        "side": "BUY",
        "quantity": 7,
        "tif": "GTC",
    }
]

api.submit_orders(list_of_orders)

Reference

REST

By default, EasyIB assumes the gateway session is open at https://localhost:5000 withtout a SSL certificate. A custom url and SSL certificate can be set by:

api = easyib.REST(url="https://localhost:5000", ssl=False)

API REST Methods

See the official documentation of the End Point at https://www.interactivebrokers.com/api/doc.html

REST Method End Point Result
get_accounts() Get portfolio/accounts list
switch_account(accountId: str) Post iserver/account/{accoutId} dict
get_cash() Get portfolio/{accountId}/ledger float
get_netvalue() Get portfolio/{accountId}/ledger float
get_conid(symbol: str) Get trsv/stocks int
get_portfolio() Get portfolio/{accountId}/positions/0 dict
reply_yes(id: str) Post iserver/reply/{id} dict
submit_orders(list_of_orders: list, reply_yes=True) Post iserver/account/{acountId}/orders dict
get_order(orderId: str) Get iserver/account/order/satus/ dict
get_live_orders(filters=[]) Get iserver/account/orders dict
cancel_order(orderId: str) Delete iserver/account/{accountId}/order/{orderId} dict
modify_order(orderId=None, order=None, reply_yes=True) Post iserver/account/{accountId}/order/{orderId} dict
get_bars(symbol: str, period="1w", bar="1d", outsideRth=False) Get iserver/marketdata/history dict
ping_server() Post tickle dict
get_auth_status() Post iserver/auth/status dict
re_authenticate() Post iserver/reauthenticate None
log_out() Post logout None
Métamorphose Renamer v2

Métamorphose 2 Métamorphose is a graphical mass renaming program for files and folders. These are the command line options: -h, --help Show hel

Métamorphose 129 Dec 30, 2022
LoL 台版10周年活動自動輸入邀請碼

LoLTW_10Year_88Event LoLTW 8.8 周年慶 邀請碼自動輸入 設定 在 LoLTW_10Year_88Evnet.exe 的位置建立一個檔案 .env,內容如下 Bahamut_Discussion = https://forum.gamer.com.tw/C.php?bsn

古丁丁 5 Dec 13, 2021
Currency Merger is a simple tool for joining values in different currencies

Currency Merger Description Currency Merger is a simple tool for joining values in different currencies. For example, if I have money in USD, EUR, BRL

Arthur Diniz 1 Feb 08, 2022
Changes your desktop wallpaper based on the weather.

WallPaperChanger 🖼️ Description ⛈️ This Python script changes your desktop wallpaper based on the weather. Cloning 🌀 $ git clone https://github.com/

Clarence Yang 74 Nov 29, 2022
PyDiscord, a maintained fork of discord.py, is a python wrapper for the Discord API.

discord.py A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. The Future of discord.py Please read the gi

Omkaar 1 Jan 16, 2022
streamlit translator is used to detect and translate between languages created using gTTS, googletrans, pillow and streamlit python packages

Streamlit Translator Streamlit Translator is a simple translator app to detect and translate between languages. Streamlit Translator gets text and lan

Siva Prakash 5 Apr 05, 2022
Bitstamp API wrapper for Python

NOTICE: THIS REPOSITORY IS NO LONGER ACTIVELY MAINTAINED It is highly unlikely that I will respond to PRs and questions about usage. This library was

Jack Preston 53 Mar 09, 2022
Amazon AWS Web Tool (view only)

Amazon AWS Web Tool (AAWT) discontinued Features Cloudfront (simple) EC2 (With Charts and Prices) EC2 Reserved EBS ELB (With Charts) Obs:. only classi

Carlos Augusto Malucelli 9 Nov 07, 2022
GitNews: Github webhooks for Telegram

GitNews - Github webhooks for Telegram Setup: server: clone repo git clone https

Druv Jagdish 1 Feb 14, 2022
Script Crack Facebook, and Instagram 🚶‍♂

in-mbf Script Crack Facebook, and Instagram 🚶‍♂ Bukti Install Script $ pkg update && pkg upgrade $ pkg install git $ pkg install python2 $ pip2 insta

Yumasaa 5 Dec 27, 2021
Discord Token Generator of a project - Some stupids ppl are trying to leak it so i'm leaking faster :)

Original creator: Rolf (dort) HCaptcha Bypasser: h0nde Shark.Solar Discord Token Generator of a project - Some stupids ppl are trying to leak it so i'

Stanley 14 Sep 29, 2021
A telegram bot does not allow channels to send messages to the telegram supergroup

Channel Message Handler Getting started Installation $ git clone https://github.com/AbhijithNT/GroupChannelHandler.git Change directory $ cd ChannelMe

Abhijith N T 0 Dec 26, 2021
A Discord bot written in Python that can be used to control event management on a server.

Event Management Discord Bot A Discord bot written in Python that can be used to control event management on a Discord server. Made originally for GDS

Suvaditya Mukherjee 2 Dec 07, 2021
An Anime Theme Telegram group management bot. With lot of features.

Emilia Project Emilia-Prjkt is a modular bot running on python3 with anime theme and have a lot features. Easiest Way To Deploy On Heroku This Bot is

ZenitsuID #M•R•T™ 3 Feb 03, 2022
汪汪Bot是一个Telegram Bot,用于帮助你管理一台服务器上的Docker

WangWangBot 汪汪Bot是一个Telegram Bot,用于帮助你管理一台服务器上的Docker运行的Bot。这是使用视频: 部署说明 安装运行 准备 local.env 普通版本 BOT_TOKEN=你的BOT_TOKEN ADMINS=使用,分隔的管理员ID列表 如果你使用doppl

老房东的代码练习册 56 Aug 23, 2022
A frame to create discord bots (for myself) that uses cogs, JSON, activities, and more.

dpy-frame A frame to create discord bots (for myself) that uses cogs, JSON, activities, and more. NOTE: Documentation is incomplete, so please wait un

Apple Discord 1 Nov 06, 2021
CnCL - CnCLess it's an Easy to deploy Botnet without CnC/C2

CnCL CnCLess it's an Easy to deploy Botnet without CnC/C2, Harder to track and t

ZSendokame 2 Jan 10, 2022
🔏 Discordちゃんねる ◆wGFzKUzY7E

使い方 discord.pyをインストール. python -m pip install -r requirements.txtを実行. bot.pyと同じ階層に.tokenを用意. bot.pyを実行. ※現状、使用しているライブラリの関係でWindowsOSは未対応です。 コマンド ニックネーム

Gattxxa 3 Feb 02, 2022
A Python library for miHoYo bbs and HoYoLAB Community

A Python library for miHoYo bbs and HoYoLAB Community. genshin 原神签到小助手

384 Jan 05, 2023
Use CSV files as a Nornir Inventory source with hosts, groups and defaults.

nornir_csv Use CSV files as a Nornir Inventory source with hosts, groups and defaults. This can be used as an equivalent to the Simple Inventory plugi

Matheus Augusto da Silva 2 Aug 13, 2022