Skip to main content

IBKR trading + SEC research API gateway

Project description

AlphaMeta

AlphaMeta is a REST API gateway for IBKR (Interactive Brokers) — live trading and real-time market data for stocks, options, futures, and crypto via a standardized REST API. Commands run as HTTP endpoints behind a FastAPI gateway, callable via curl or any HTTP client.

Also includes SEC EDGAR research commands — filing listing, 13F investors, insider trades, XBRL financial statements and segment data.

Quick start

pip install alphameta

Requires an IBKR Gateway or TWS instance for trading operations.

# Start the API server
alphameta start

# Live quotes
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "quote AAPL"}'

# SEC research (no IBKR needed)
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "filing AAPL 10-K"}'

The API serves at http://127.0.0.1:18080 by default.

Features

Commands by category

Category Commands
Live Market Quotes quote, add, remove (rm), kline, depth, chain, range, info, align, prequalify, oadd, filing (filings), investors (inv), insider-trades (insider), financial-report (frep), financial-statement (fstmt), sec, calc-index (calcidx), capital-flow (capflow), consensus, operating (ops)
Order Management buy, cancel, modify, evict, fast, scale, straddle
Portfolio positions (ls), balance, orders, executions, report
Technical Indicators dex, gex, dge, maxpain
Predicate Management ifthen, iflist (ifls), ifrm, ifclear, ifgroup, auto
Quote Management qadd, qremove (qrm), qlist, qsave, qrestore, qdelete, qclean, qsnapshot, qloadsnapshot, colorset, colorsload
Schedule Management sched-add (sadd), sched-list (slist), sched-cancel (scancel)
Task Management tasklist, taskcancel
Connection rid
Utilities cash, math, alert, say, expand, simulate, paper, reporter, daydumper, details, advice, alias, clear, meta, qualify, reconnect, calendar, set, unset

Examples

Bulk symbol expansion:

# Add/remove multiple option strikes at once
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "add SPY240412{P,C}005{1,2,3}0000"}'

# Remove by row id
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "rm :{31..37}"}'

Multi-symbol orders:

# Buy ~$15k of each symbol
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "expand buy {META,MSFT,NVDA,AMD,AAPL} $15_000 MID"}'

Flexible order pricing:

# By quantity or dollar amount, with bracket orders
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "buy AAPL 100 AF @ 233.33 ± 10"}'

Conditional triggers:

# Execute command when price condition is met
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "if AAPL last > 300: buy AAPL 100 AF"}'

Account calculator:

# Calculate shares buyable on margin, combine with growth projections
curl -X POST "http://127.0.0.1:18080/api/v1/execute" \
  -H "Content-Type: application/json" \
  -d '{"cmd": "(/ :BP3 AAPL)"}'

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

alphameta-2.4.3-cp313-cp313-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.13Windows x86-64

alphameta-2.4.3-cp313-cp313-win32.whl (5.9 MB view details)

Uploaded CPython 3.13Windows x86

alphameta-2.4.3-cp313-cp313-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

alphameta-2.4.3-cp312-cp312-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.12Windows x86-64

alphameta-2.4.3-cp312-cp312-win32.whl (5.9 MB view details)

Uploaded CPython 3.12Windows x86

alphameta-2.4.3-cp312-cp312-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file alphameta-2.4.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: alphameta-2.4.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for alphameta-2.4.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b6897b4841ea7679ade9826a22194eeb704ff5bc594a59b26dddceece6a8e680
MD5 a3ddfe7db9f0de0f7e4771773e30ba73
BLAKE2b-256 61caf9ad4e728637ae1bad82ae9cf0265b585fd6ae7a0b1c38a41b34cb0c451c

See more details on using hashes here.

File details

Details for the file alphameta-2.4.3-cp313-cp313-win32.whl.

File metadata

  • Download URL: alphameta-2.4.3-cp313-cp313-win32.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for alphameta-2.4.3-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 fda454771614c1455bd3ffd13cc4f137842ee35e08dc9ef7a1f6dbb515c00f41
MD5 8761dfdb569811bf3a70962404f03efd
BLAKE2b-256 e8e1a5de75fca8a012ee8f3e59689bc07386a91ee589920ccadc224a9704bc07

See more details on using hashes here.

File details

Details for the file alphameta-2.4.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for alphameta-2.4.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc599fba826a221669f184c4e1b04e1ea7019bdfc2ffadfe0418850df393f924
MD5 15a61edb0370c1023c5775d1c383a652
BLAKE2b-256 d84a0fa1d82ff766ba8713d882d07c0de8bd7bfac813001bfd267bc7d4d1164d

See more details on using hashes here.

File details

Details for the file alphameta-2.4.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: alphameta-2.4.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for alphameta-2.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 55b0842c0ad821e622b37b71cd9d7b375b8e292d287bf5b59c31952977da7937
MD5 9b21f9bfe2fdd690686bbd3c53640bd5
BLAKE2b-256 1dcf60f64850bd49a66518ff4fd9f1d1c7d4803225809bbce9883ecd3863e054

See more details on using hashes here.

File details

Details for the file alphameta-2.4.3-cp312-cp312-win32.whl.

File metadata

  • Download URL: alphameta-2.4.3-cp312-cp312-win32.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for alphameta-2.4.3-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 f13ac28d04215342a1812d1d3506741ee9bdd465e3e21bed4bedbad3e77bbdfe
MD5 fe5afc6e374b7567bee19bea204e8b66
BLAKE2b-256 bb3327824bfc1f0bfd0ea1b25f96203a982cc144f364288eabf59a8e61897343

See more details on using hashes here.

File details

Details for the file alphameta-2.4.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for alphameta-2.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30a11ce7c45a40afa8e61dcfda3bfa93a8739f5cee5d74497f83bb9c7dd8a4e8
MD5 6e9a37957fa27330b122a2574e4aa4e0
BLAKE2b-256 e872fcf400e97dc9f9fd9c7940107595b17f43f28f466fae0b9573a2ffcd1db0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page