Interactive Brokers Portfolio API

Portfolio positions and account summaries

Operations 2

GET /portfolio/{accountId}/positions/{pageId} Get portfolio positions #
GET /portfolio/{accountId}/summary Get account summary #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/interactive-brokers-portfolio-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

interactive-brokers-portfolio-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Interactive Brokers Web Accounts Portfolio API
  description: The Interactive Brokers Web API is a RESTful API that provides programmatic access to IBKR trading, portfolio management, market data, and account information. The API consolidates the Client Portal Web API, Digital Account Management, and Flex Web Service into a unified interface. It supports OAuth 2.0 authentication and provides endpoints for order placement, portfolio monitoring, real-time and historical market data, and account management across global markets.
  version: '1.0'
  contact:
    name: Interactive Brokers API Support
    url: https://www.interactivebrokers.com/campus/ibkr-api-page/ibkr-api-home/
servers:
- url: https://localhost:5000/v1/api
  description: Client Portal Gateway (Local)
security:
- oauth2: []
tags:
- name: Portfolio
  description: Portfolio positions and account summaries
paths:
  /portfolio/{accountId}/positions/{pageId}:
    get:
      operationId: getPositions
      summary: Get portfolio positions
      description: Returns a list of positions for the given account.
      tags:
      - Portfolio
      parameters:
      - name: accountId
        in: path
        required: true
        schema:
          type: string
        description: The account identifier
      - name: pageId
        in: path
        required: true
        schema:
          type: string
        description: Page number for pagination (starts at 0)
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Position'
  /portfolio/{accountId}/summary:
    get:
      operationId: getAccountSummary
      summary: Get account summary
      description: Returns account summary values including net liquidation value, total cash, and other balances.
      tags:
      - Portfolio
      parameters:
      - name: accountId
        in: path
        required: true
        schema:
          type: string
        description: The account identifier
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountSummary'
components:
  schemas:
    Position:
      type: object
      properties:
        acctId:
          type: string
        conid:
          type: integer
        contractDesc:
          type: string
        position:
          type: number
        mktPrice:
          type: number
        mktValue:
          type: number
        avgCost:
          type: number
        unrealizedPnl:
          type: number
    AccountSummary:
      type: object
      properties:
        accountready:
          type: object
        accountcode:
          type: object
        netliquidation:
          type: object
        totalcashvalue:
          type: object
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://www.interactivebrokers.com/authorize
          tokenUrl: https://www.interactivebrokers.com/token
          scopes: {}
externalDocs:
  description: IBKR Web API Documentation
  url: https://www.interactivebrokers.com/campus/ibkr-api-page/webapi-doc/