{"id":27629311,"url":"https://github.com/toptalent-23/ibkr_trading_api","last_synced_at":"2025-08-25T08:17:14.409Z","repository":{"id":289349590,"uuid":"970955494","full_name":"TopTalent-23/IBKR_Trading_API","owner":"TopTalent-23","description":"Python sync/async framework for Interactive Brokers Trading API and Utility tools for IBKR TWS API","archived":false,"fork":false,"pushed_at":"2025-04-22T20:19:24.000Z","size":16810,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T16:42:25.534Z","etag":null,"topics":["asyncio","ibapi","interactive-brokers","python","trading","twsapi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TopTalent-23.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"erdewit","custom":"www.paypal.me/erdewit"}},"created_at":"2025-04-22T19:40:10.000Z","updated_at":"2025-04-22T20:19:28.000Z","dependencies_parsed_at":"2025-04-22T20:47:16.093Z","dependency_job_id":"6a3b6a5c-caff-4533-b6d0-1e753e341bbc","html_url":"https://github.com/TopTalent-23/IBKR_Trading_API","commit_stats":null,"previous_names":["toptalent-23/ibkr_trading_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TopTalent-23/IBKR_Trading_API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTalent-23%2FIBKR_Trading_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTalent-23%2FIBKR_Trading_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTalent-23%2FIBKR_Trading_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTalent-23%2FIBKR_Trading_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TopTalent-23","download_url":"https://codeload.github.com/TopTalent-23/IBKR_Trading_API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TopTalent-23%2FIBKR_Trading_API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272031419,"owners_count":24861687,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["asyncio","ibapi","interactive-brokers","python","trading","twsapi"],"created_at":"2025-04-23T15:16:17.384Z","updated_at":"2025-08-25T08:17:14.357Z","avatar_url":"https://github.com/TopTalent-23.png","language":"Python","funding_links":["https://github.com/sponsors/erdewit","www.paypal.me/erdewit"],"categories":[],"sub_categories":[],"readme":"\nIBKR_Trading_API\n------------\n\n\nThe goal of the IB-insync library is to make working with the\n`Trader Workstation API \u003chttp://interactivebrokers.github.io/tws-api/\u003e`_\nfrom Interactive Brokers as easy as possible.\n\nThe main features are:\n\n* An easy to use linear style of programming;\n* An `IB component \u003chttps://ib-insync.readthedocs.io/api.html#module-ib_insync.ib\u003e`_\n  that automatically keeps in sync with the TWS or IB Gateway application;\n* A fully asynchonous framework based on\n  `asyncio \u003chttps://docs.python.org/3/library/asyncio.html\u003e`_\n  and\n  `eventkit \u003chttps://github.com/erdewit/eventkit\u003e`_\n  for advanced users;\n* Interactive operation with live data in Jupyter notebooks.\n\nBe sure to take a look at the\n`notebooks \u003chttps://ib-insync.readthedocs.io/notebooks.html\u003e`_,\nthe `recipes \u003chttps://ib-insync.readthedocs.io/recipes.html\u003e`_\nand the `API docs \u003chttps://ib-insync.readthedocs.io/api.html\u003e`_.\n \nConfigure IBKR Trade Workstation API\n------------\n\n.. image:: docs/IBKR-TWS-GlobalConfiguration-API-Settings.png\n   :alt: Screenshot of the project in action\n   :width: 600px\n   :align: center\n\n.. image:: docs/IBKR-TWS-GlobalConfiguration-API-Settings-Demo.png\n   :alt: Screenshot of the project in action\n   :width: 600px\n   :align: center\n\n\nSpoof detector\n------------\nVisualizes the bid and ask orders and sales in single window with different type of charts. Run `python spoof_detector/spoof_detector.py --help`. You will see all the options\n\n.. image:: docs/lineplot.png\n   :alt: Screenshot of the project in action\n   :width: 600px\n   :align: center\n\n.. image:: docs/heatmap.png\n   :alt: Screenshot of the project in action\n   :width: 600px\n   :align: center\n\nInstallation\n------------\n\n::\n\n    pip install ib_insync\n\nRequirements:\n\n* Python 3.6 or higher;\n* A running TWS or IB Gateway application (version 1023 or higher).\n  Make sure the\n  `API port is enabled \u003chttps://interactivebrokers.github.io/tws-api/initial_setup.html\u003e`_\n  and 'Download open orders on connection' is checked.\n\nThe ibapi package from IB is not needed.\n\nExample\n-------\n\nThis is a complete script to download historical data:\n\n.. code-block:: python\n\n    from ib_insync import *\n    # util.startLoop()  # uncomment this line when in a notebook\n\n    ib = IB()\n    ib.connect('127.0.0.1', 7497, clientId=1)\n\n    contract = Forex('EURUSD')\n    bars = ib.reqHistoricalData(\n        contract, endDateTime='', durationStr='30 D',\n        barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True)\n\n    # convert to pandas dataframe (pandas needs to be installed):\n    df = util.df(bars)\n    print(df)\n\nOutput::\n\n                       date      open      high       low     close  volume  \\\n    0   2019-11-19 23:15:00  1.107875  1.108050  1.107725  1.107825      -1\n    1   2019-11-20 00:00:00  1.107825  1.107925  1.107675  1.107825      -1\n    2   2019-11-20 01:00:00  1.107825  1.107975  1.107675  1.107875      -1\n    3   2019-11-20 02:00:00  1.107875  1.107975  1.107025  1.107225      -1\n    4   2019-11-20 03:00:00  1.107225  1.107725  1.107025  1.107525      -1\n    ..                  ...       ...       ...       ...       ...     ...\n    705 2020-01-02 14:00:00  1.119325  1.119675  1.119075  1.119225      -1\n\n\nDocumentation\n-------------\n\nThe complete `API documentation \u003chttps://ib-insync.readthedocs.io/api.html\u003e`_.\n\n`Changelog \u003chttps://ib-insync.readthedocs.io/changelog.html\u003e`_.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoptalent-23%2Fibkr_trading_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoptalent-23%2Fibkr_trading_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoptalent-23%2Fibkr_trading_api/lists"}