{"id":14064818,"url":"https://github.com/utilmon/EasyIB","last_synced_at":"2025-07-29T19:31:27.716Z","repository":{"id":45733973,"uuid":"392500924","full_name":"utilmon/EasyIB","owner":"utilmon","description":"Python wrapper for Interactive Brokers Client Portal Web API","archived":false,"fork":false,"pushed_at":"2024-07-19T08:09:57.000Z","size":1115,"stargazers_count":88,"open_issues_count":2,"forks_count":24,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-08T11:12:50.551Z","etag":null,"topics":["client-portal","interactive-brokers","python","rest-api","trading-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utilmon.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-04T00:56:34.000Z","updated_at":"2024-10-21T19:47:51.000Z","dependencies_parsed_at":"2024-08-13T07:07:39.329Z","dependency_job_id":"27171b70-3dda-4738-bab0-d8ffc2981f14","html_url":"https://github.com/utilmon/EasyIB","commit_stats":null,"previous_names":["utilmon/easyib","ashpipe/easyib"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmon%2FEasyIB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmon%2FEasyIB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmon%2FEasyIB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utilmon%2FEasyIB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utilmon","download_url":"https://codeload.github.com/utilmon/EasyIB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228040864,"owners_count":17860211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client-portal","interactive-brokers","python","rest-api","trading-api"],"created_at":"2024-08-13T07:04:05.969Z","updated_at":"2024-12-04T03:31:34.959Z","avatar_url":"https://github.com/utilmon.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"EasyIB: Python Wrapper for Interactive Brokers API\n======================================================\n\n.. image:: https://img.shields.io/pypi/v/easyib\n    :target: https://pypi.org/pypi/easyib/\n.. image:: https://img.shields.io/pypi/pyversions/easyib\n    :target: https://pypi.org/pypi/easyib/\n.. image:: https://img.shields.io/pypi/l/easyib\n    :target: https://pypi.org/pypi/easyib/\n.. image:: https://readthedocs.org/projects/easyib/badge/?version=latest\n    :target: https://easyib.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n|\n\n.. figure:: https://raw.githubusercontent.com/ashpipe/EasyIB/main/docs/logo.png\n    :width: 400\n    :align: center\n    \n\"Logo for 'EasyIB'\" according to Midjourney\n\n|\n|   EasyIB is an unofficial python wrapper for `Interactive Brokers Client Portal Web API \u003chttps://interactivebrokers.github.io/cpwebapi/\u003e`__. The motivation for the project was to build a Python wrapper that can run on Linux/cloud environments. Thus, Client Portal API was preferred over Trader Workstation (TWS) API.\n\nPlease see https://easyib.readthedocs.io for the full documentation.\n\nFeatures\n---------\nNotable functionality includes:\n\n* Pull account info, portfolio, cash balance, the net value\n* Pull historical market data\n* Submit, modify, cancel orders\n* Get order status, list of live orders\n* Ping (tickle) server, get authentication status, re-authenticate\n\nHow to install\n--------------\n\nEasyIB assumes a gateway session is active and authenticated.\nFollow instructions at https://interactivebrokers.github.io/cpwebapi/ for authentication.\nA custom package such as `Voyz/IBeam \u003chttps://github.com/voyz/ibeam\u003e`__ can also be used for setting up an active session.\nPart Time Larry has an excellent youtube tutorial on this topic: https://www.youtube.com/watch?v=O1OhiiCx6Ho.\n\nEasyIB was developed under the `Voyz/IBeam \u003chttps://github.com/voyz/ibeam\u003e`__ docker image environment.\nYou can verify if a gateway session is active by typing ``curl -X GET \"https://localhost:5000/v1/api/one/user\" -k`` at bash terminal.\n\nOnce a gateway session is running, ``pip`` command can be used to install EasyIB:\n\n.. code-block:: bash\n\n    pip install easyib\n\nQuick start\n------------\nHistorical data\n^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n    import easyib\n\n    ib = easyib.REST() # default parameters: url=\"https://localhost:5000\", ssl=False\n\n    bars = ib.get_bars(\"AAPL\", period=\"1w\", bar=\"1d\")\n    print(bars)\n\nSubmitting an order\n^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n    list_of_orders = [\n        {\n            \"conid\": ib.get_conid(\"AAPL\"),\n            \"orderType\": \"MKT\",\n            \"side\": \"BUY\",\n            \"quantity\": 7,\n            \"tif\": \"GTC\",\n        }\n    ]\n    \n    order = ib.submit_orders(list_of_orders)\n    print(order)\n\n\nReference\n-------------\nFor the complete reference, please visit https://easyib.readthedocs.io/en/latest/reference.html.\n\nREST\n^^^^^\nBy default, EasyIB assumes the gateway session is open at https://localhost:5000 without an SSL certificate. A custom URL and SSL certificate can be set by:\n\n.. code-block:: python\n\n    ib = easyib.REST(url=\"https://localhost:5000\", ssl=False)\n\nAPI REST Methods\n^^^^^^^^^^^^^^^^^\nDocumentation of available functions is at https://easyib.readthedocs.io/en/latest/reference.html.\n\nSee the official documentation of the End Point at https://www.interactivebrokers.com/api/doc.html.\n\n.. list-table:: \n   :widths: 50 50 25\n   :header-rows: 1\n\n   * - REST Method\n     - End Point\n     - Result\n   * - ``get_accounts()``\n     - ``Get portfolio/accounts``\n     - ``list``\n   * - ``switch_account(accountId: str)``\n     - ``Post iserver/account/{accountId}``\n     - ``dict``\n   * - ``get_cash()``\n     - ``Get portfolio/{accountId}/ledger``\n     - ``float``\n   * - ``get_netvalue()``\n     - ``Get portfolio/{accountId}/ledger``\n     - ``float``\n   * - ``get_conid(symbol: str, instrument_filters: Dict = None, contract_filters: Dict = {\"isUS\": True})``\n     - ``Get trsv/stocks``\n     - ``int``\n   * - ``get_fut_conids(symbol: str)``\n     - ``Get trsv/futures``\n     - ``list``\n   * - ``get_portfolio()``\n     - ``Get portfolio/{accountId}/positions/0``\n     - ``dict``\n  \n   * - ``reply_yes(id: str)``\n     - ``Post iserver/reply/{id}``\n     - ``dict``\n\n   * - ``submit_orders(list_of_orders: list, reply_yes=True)``\n     - ``Post iserver/account/{acountId}/orders``\n     - ``dict``\n\n   * - ``get_order(orderId: str)``\n     - ``Get iserver/account/order/status/``\n     - ``dict``\n\n   * - ``get_live_orders(filters=None)``\n     - ``Get iserver/account/orders``\n     - ``dict``\n\n   * - ``cancel_order(orderId: str)``\n     - ``Delete iserver/account/{accountId}/order/{orderId}``\n     - ``dict``\n\n   * - ``modify_order(orderId=None, order=None, reply_yes=True)``\n     - ``Post iserver/account/{accountId}/order/{orderId}``\n     - ``dict``\n\n   * - ``get_bars(symbol: str, period=\"1w\", bar=\"1d\", outsideRth=False, conid=\"default\")``\n     - ``Get iserver/marketdata/history``\n     - ``dict``\n\n   * - ``ping_server()``\n     - ``Post tickle``\n     - ``dict``\n   * - ``get_auth_status()``\n     - ``Post iserver/auth/status``\n     - ``dict``\n   * - ``re_authenticate()``\n     - ``Post iserver/reauthenticate``\n     - ``None``\n   * - ``log_out()``\n     - ``Post logout``\n     - ``None``\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futilmon%2FEasyIB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futilmon%2FEasyIB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futilmon%2FEasyIB/lists"}