Skip to content

Accessing Interactive Brokers via API

July 5, 2026

2 min read

Interactive Brokers programmatic access to trading and account data via the Client Portal API (REST). Here’s what I learned about getting started.

Web API

The Client Portal API is the modern REST-based approach, officially supported by Interactive Brokers.

Setup Steps

Download the API gateway .

To run it, we also need to install Java environment.

brew install --cask temurin

After installation, the java command should be available:

java --version
openjdk 26.0.1 2026-04-21
OpenJDK Runtime Environment Temurin-26.0.1+8 (build 26.0.1+8)
OpenJDK 64-Bit Server VM Temurin-26.0.1+8 (build 26.0.1+8, mixed mode, sharing)

Unzip the clientportal.gw.zip downloaded earlier. Also need to modify the root/conf.yaml file so it uses 5001 instead of 5000 to avoid conflict for the listenPort field.

Finally, open a terminal under the unzipped clientportal.gw folder:

bin/run.sh root/conf.yaml
running
 runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*
 config file  : root/conf.yaml
...
Java Version: 26.0.1
****************************************************
version: a27ed42161ad96c53e715ca5c5e3e3fa4cff5262 Mon, 24 Apr 2023 15:41:53 -0400
****************************************************
This is the Client Portal Gateway
for any issues, please contact [email protected]
and include a copy of your logs
****************************************************
https://www.interactivebrokers.com/api/doc.html
****************************************************
Open https://localhost:5001 to login

Follow the instruction to open https://localhost:5001 to login use the IBKR credentials.

Next Steps

With the gateway running and authenticated, we can now make REST requests to https://localhost:5001 to automate trading, fetch account data, and manage orders. The API documentation has comprehensive endpoint references for building out your integration by just pointing it in our favorite AI tools.