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.2-cp313-cp313-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13Windows x86

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

alphameta-2.4.2-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.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: alphameta-2.4.2-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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f0963c7f0576b8252990a0927b20e3643ec28439cce9ba7f416e25b5d7ba3480
MD5 2c0c765e18e397d73534df0a4f2eadf9
BLAKE2b-256 300a90ec2a8190e558201e5be5d246e2abca38c64b8648ea5d772e476816742c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alphameta-2.4.2-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.2-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 75d7bf32a6dad22fdace6decbc4b2155b77e591bffcda942030cac058f4b4256
MD5 4cb38966c3e08d79697c39aed2d974f4
BLAKE2b-256 acf59e78c13232d0aca5bb0b1905bc98690d0e479ca0f1b83e44d03397fadd61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alphameta-2.4.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77e682a9a52323f9065349a7c059df6fbd4995f7f201d6a7cc5010c24676635d
MD5 055f1532e6ae59d535ef2a09e5b7087e
BLAKE2b-256 f669a9dd9ffe8e6ad4956a6a5c10ae37f73c1b73619c4a5c139f5ed34dc74edd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alphameta-2.4.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c55f9c93dbd727b29481d4dc2cf99c626ef895dd3a9601d9105fe61ce479cb29
MD5 1097ba61271a35d1986ff6291c940d0c
BLAKE2b-256 43597661f1a03f94125923a0e56f719972979539bcd773bbc679787a429190b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alphameta-2.4.2-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.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 94628442055c7fc1f1178193eac8f840c10c557284f53bc07648ba83c5fa019a
MD5 ee6aac5b6944722841721543ea7b6572
BLAKE2b-256 a158eae4d4b3ba24c900bee1e7a3e1132aacc415f19363475c085319b086073d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alphameta-2.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94094be11141649760f2cca369bc6748e44ee1a9f0ec4a0cfcbd6deeaaa0a2e7
MD5 7ed07ebff79faa34fcb7c4fe3a06a3db
BLAKE2b-256 9d200642712e2a276f82ddae2bfd82698969702862aa5b014d34cd5230590d1f

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