{"id":13449705,"url":"https://github.com/erdewit/ib_insync","last_synced_at":"2025-10-21T19:53:13.158Z","repository":{"id":41148567,"uuid":"97003332","full_name":"erdewit/ib_insync","owner":"erdewit","description":"Python sync/async framework for Interactive Brokers API","archived":true,"fork":false,"pushed_at":"2024-03-14T19:50:06.000Z","size":14831,"stargazers_count":2827,"open_issues_count":21,"forks_count":763,"subscribers_count":182,"default_branch":"master","last_synced_at":"2024-10-29T22:54:18.114Z","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/erdewit.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},"funding":{"github":"erdewit","custom":"www.paypal.me/erdewit"}},"created_at":"2017-07-12T12:09:24.000Z","updated_at":"2024-10-28T23:28:32.000Z","dependencies_parsed_at":"2023-12-11T13:11:15.632Z","dependency_job_id":"d77ca901-b942-4b09-b1e9-738fb92ba9be","html_url":"https://github.com/erdewit/ib_insync","commit_stats":{"total_commits":670,"total_committers":37,"mean_commits":18.10810810810811,"dds":0.07462686567164178,"last_synced_commit":"96a5b7f8e835659b17265e92b66885be5358bc67"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdewit%2Fib_insync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdewit%2Fib_insync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdewit%2Fib_insync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdewit%2Fib_insync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdewit","download_url":"https://codeload.github.com/erdewit/ib_insync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234426709,"owners_count":18830955,"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":["asyncio","ibapi","interactive-brokers","python","trading","twsapi"],"created_at":"2024-07-31T06:00:51.881Z","updated_at":"2025-09-27T10:31:38.528Z","avatar_url":"https://github.com/erdewit.png","language":"Python","funding_links":["https://github.com/sponsors/erdewit","www.paypal.me/erdewit"],"categories":["Broker APIs","金融数据处理","Time-Series \u0026 Financial","Python","Curated List"],"sub_categories":["Risk","Crypto","Others","API Integrations/Connectors"],"readme":"|Build| |Group| |PyVersion| |Status| |PyPiVersion| |License| |Downloads| |Docs|\n\nNotice\n============\n\n::\n\n  Unfortunately, our dear brother Ewald de Wit passed away monday, March eleven as a result of a serious illness last year.\n  Although we were not involved in his activities on this platform, we felt the due to inform you. \n  We thank you for knowing him.\n\n  Maritza and Philippe de Wit\n\nIntroduction\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\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\nDiscussion\n----------\n\nThe `insync user group \u003chttps://groups.io/g/insync\u003e`_ is the place to discuss\nIB-insync and anything related to it.\n\nDisclaimer\n----------\n\nThe software is provided on the conditions of the simplified BSD license.\n\nThis project is not affiliated with Interactive Brokers Group, Inc.'s.\n\nGood luck and enjoy,\n\n:author: Ewald de Wit \u003cewald.de.wit@gmail.com\u003e\n\n.. _`Interactive Brokers Python API`: http://interactivebrokers.github.io\n\n.. |Group| image:: https://img.shields.io/badge/groups.io-insync-green.svg\n   :alt: Join the user group\n   :target: https://groups.io/g/insync\n\n.. |PyPiVersion| image:: https://img.shields.io/pypi/v/ib_insync.svg\n   :alt: PyPi\n   :target: https://pypi.python.org/pypi/ib_insync\n\n.. |CondaVersion| image:: https://img.shields.io/conda/vn/conda-forge/ib-insync.svg\n   :alt: Conda\n   :target: https://anaconda.org/conda-forge/ib-insync\n\n.. |PyVersion| image:: https://img.shields.io/badge/python-3.6+-blue.svg\n   :alt:\n\n.. |Status| image:: https://img.shields.io/badge/status-beta-green.svg\n   :alt:\n\n.. |License| image:: https://img.shields.io/badge/license-BSD-blue.svg\n   :alt:\n\n.. |Docs| image:: https://img.shields.io/badge/Documentation-green.svg\n   :alt: Documentation\n   :target: https://ib-insync.readthedocs.io/api.html\n\n.. |Downloads| image:: https://static.pepy.tech/badge/ib-insync\n   :alt: Number of downloads\n   :target: https://pepy.tech/project/ib-insync\n\n.. |Build| image:: https://github.com/erdewit/ib_insync/actions/workflows/test.yml/badge.svg?branch=master\n   :target: https://github.com/erdewit/ib_insync/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdewit%2Fib_insync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdewit%2Fib_insync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdewit%2Fib_insync/lists"}