ib-insync

Connect to Interactive Brokers TWS/Gateway API and place orders with ib_insync.

1|Updated May 19, 2026
One-click install
npx skills add https://github.com/njohnson101/AgenticQuantSystem --skill ib-insync-njohnson101
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ib-insync
Source: https://github.com/njohnson101/AgenticQuantSystem/tree/main/course/08_production_hardening/.claude/skills/ib-insync
Command: npx skills add https://github.com/njohnson101/AgenticQuantSystem --skill ib-insync-njohnson101

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ib_insync, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables the seamless implementation of code for Interactive Brokers' TWS/Gateway using ib_insync, providing an efficient interface for connecting, fetching data, placing orders, and monitoring market activities.

Core Features & Use Cases

  • Connection Handling: Connect to TWS or IB Gateway, managing ports, client IDs, and timeouts.
  • Data Fetching: Access historical data, live market data, and real-time bar updates.
  • Order Placement: Place market, limit, stop, and bracket orders, with detailed monitoring and logging.
  • Account Management: Retrieve account values, positions, and P&L.
  • Event Handling: React to live updates through event-driven programming.
  • Use Case: If you need to automate trading logic with Interactive Brokers and are familiar with Python, this Skill can help you connect to the IB API, fetch market data, place and monitor orders, and react to live updates.

Quick Start

Use the ib-insync skill to connect to the Interactive Brokers API and place a market order for 100 shares of "AAPL".

Frequently Asked Questions about ib-insync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Interactive Brokers order placement using Python?

You can automate Interactive Brokers order placement by implementing code that connects to the TWS or IB Gateway API to submit market, limit, stop, and bracket orders with detailed monitoring and logging.

How does ib_insync handle live market data and real-time bar updates?

ib_insync handles live market data by establishing a synchronous interface over asyncio, enabling event-driven programming to fetch data and react to real-time bar updates and live market activities.

Do I need ib_insync to connect to Interactive Brokers TWS or IB Gateway?

Yes, you need the ib_insync library to establish a synchronous interface over asyncio for API interactions, handling connection management including ports, client IDs, and timeouts.

What's the best way to retrieve account values, positions, and P&L from Interactive Brokers?

The best way to retrieve account values, positions, and P&L from Interactive Brokers is by using the ib_insync library to interact with the TWS or IB Gateway API for comprehensive account management.

Can I use ib_insync for both automated trading and market data analysis?

Yes, you can use ib_insync for both automated trading and market data analysis, as it supports fetching historical data, placing orders, and monitoring live updates through event-driven programming.