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
5 Oct 19, 2022
A self-hosted Discord music bot.

Cassette A self-hosted Discord music bot. Requirements py-cord pynacl pytube Setup Intended to be hosted on Heroku. Fork or clone this repo. Create a

Lohan 8 Apr 28, 2022
A simple script that loads and hot-reloads cogs when you save any changes

DiscordBot-HotReload A simple script that loads and hot-reloads cogs when you save any changes Usage @bot.event async def on_ready(): from HotRelo

2 Jan 14, 2022
Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

Video Stream is an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat πŸ§ͺ Get SESSION_NAME from below: Pyrogram

Jonathan 6 Feb 08, 2022
Protection-UB - Simple Group Protection userbot running on python3 with ARQ

Protection-UB Simple Group Protection userbot running on python3 with ARQ ⚠️ Not

szsupunma 1 Feb 06, 2022
:cloud: Python API for ThePirateBay.

Unofficial Python API for ThePirateBay. Build Status Test Coverage Version Downloads (30 days) Installation $ pip install ThePirateBay Note that ThePi

Karan Goel 334 Oct 21, 2022
ΠžΠ±Π΅Ρ€Ρ‚ΠΊΠ° для ΠΌΠΈΠ½ΠΈ-ΠΈΠ³Ρ€Ρ‹ "Ρ€Π°Π±Ρ‹" Π½Π° python

Slaves API Π‘ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° для ΠΈΠ³Ρ€Ρ‹ Π Π°Π±Ρ‹ Π½Π° Python. Π‘ΠΎΠ»ΡŒΡˆΠ°Ρ ΠΏΡ€ΠΎΡΡŒΠ±Π° ΠŸΠΎΡΡ‚Π°Π²ΡŒΡ‚Π΅ Π·Π²Π΅Π·Π΄ΠΎΡ‡ΠΊΡƒ Π½Π° Ρ€Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΡ€ΠΈΠΉ. Π­Ρ‚ΠΎ ΠΌΠ½ΠΎΠ³ΠΎ для мСня Π·Π½Π°Ρ‡ΠΈΡ‚. ВСрсии Π’.ΠΊ. Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΈ

Zdorov Philipp 13 Mar 31, 2021
An open source development framework to help you build data workflows and modern data architecture on AWS.

AWS DataOps Development Kit (DDK) The AWS DataOps Development Kit is an open source development framework for customers that build data workflows and

Amazon Web Services - Labs 111 Dec 23, 2022
A Telegram Message Manager Bot by @AbirHasan2005

Messages-Manager-Bot A Telegram Message Manager Bot by @AbirHasan2005. This Bot can delete specific type of messages from Group. I specially use for @

Abir Hasan 32 Nov 12, 2022
Apps related to Odoo it's calendar features

calendar Apps related to Odoo it's calendar/appointments features: online_appointment_locations: allow setting an online URL per employee online_appoi

Yenthe Van Ginneken 3 Oct 27, 2022
Π‘ΠΎΡ‚ для скачивания Ρ‚Ρ€Π΅ΠΊΠΎΠ² с Deezer ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡ ISRC ΠΈ UPC ΠΊΠΎΠ΄Ρ‹

deez_robot Запуск УстановитС Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΡ‹Π΅ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ pip install -r requirements.txt Π‘ΠΎΠ·Π΄Π°ΠΉΡ‚Π΅ Ρ„Π°ΠΉΠ» config.py ΠΈ помСститС Ρ‚ΡƒΠ΄Π° Ρ‚ΠΎΠΊΠ΅Π½ Π±ΠΎΡ‚Π° ΠΈ ARL-Ρ‚ΠΎΠΊΠ΅Π½ De

Max 4 Jul 31, 2022
Telegram bot to download tiktok video/audio

TikTokDL (Bot) Telegram RoBot to Download Tiktok video/audio. Features: πŸ‘‰ Download TikTok Video without Watermark πŸ‘‰ Download TikTok Video with Water

X-Noid 23 Nov 21, 2022
TonplaceApi - Ton.place api wrapper

tonplaceApi ton.place/tonplaceApi ΠžΠ±Π΅Ρ€Ρ‚ΠΊΠ° для ton.place Установка pip install ht

Nickolay Samedov 3 Feb 21, 2022
A Python implementation of a Youtube Subscription manager & feed viewer, also does thumbnails

BUILDING Building requires python3.10, and the build package, which can be installed via pip: python3.10 -m pip install build To install, run python3.

2 Feb 28, 2022
McTrade is a bot exploiting Binance API, open source! built in python !

Open Source Crypto Trading Bot using Binance API Report Bug Β· Request Feature Table of Contents About The Project Built With Getting Started Prerequis

Raphael Cohen 5 Jul 17, 2022
Drop-in Replacement of pychallonge

pychal Pychal is a drop-in replacement of pychallonge with some extra features and support for new Python versions. Pychal provides python bindings fo

ZED 29 Nov 28, 2022
Throttle and debounce add-on for Pyrogram

pyrothrottle Throttle and debounce add-on for Pyrogram Quickstart implementation on decorators from pyrogram import Client, filters from pyrogram.type

7 Oct 01, 2022
Bot facebook

botfb Bot facebook Login via cookies cara install $pkg update && pkg upgrade $pkg install git python $git clone https://github.com/Ainx-BOT/botfb $cd

Fahmi Dev 12 Dec 18, 2022
This repository contains free labs for setting up an entire workflow and DevOps environment from a real-world perspective in AWS

DevOps-The-Hard-Way-AWS This tutorial contains a full, real-world solution for setting up an environment that is using DevOps technologies and practic

Mike Levan 1.6k Jan 05, 2023
Retrieves GitHub Stats via `git_api` and flask.

GitHub User Search Created using Python3 and git_api, coded by JBYT27. About This is a project I decided to make for Kajam, but I decided to choose a

an aspirin 4 May 11, 2022