Metadata-Version: 2.4
Name: alphameta
Version: 2.6.5
Summary: IBKR trading + SEC research API gateway
Home-page: https://github.com/intelliscale/alphameta
Author: GAO KE
Author-email: gaoke@intelliscale.com
License: Apache-2.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.7
Requires-Dist: httpx>=0.28.1
Requires-Dist: loguru>=0.7.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: orjson>=3.6.7
Requires-Dist: pandas>=2.0.3
Requires-Dist: python-dateutil>=2.9.0
Requires-Dist: fastapi>=0.128.7
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: uvicorn>=0.40.0
Requires-Dist: ib_async>=2.0.1
Requires-Dist: prompt_toolkit>=3.0.29
Requires-Dist: questionary>=2.0.1
Requires-Dist: aiofiles>=24.1.0
Requires-Dist: aiohttp>=3.7.4
Requires-Dist: websockets>=16.0
Requires-Dist: arrow>=1.1.0
Requires-Dist: cachetools>=6.2.0
Requires-Dist: pandas-market-calendars>=4.1.4
Requires-Dist: pytz>=2020.1
Requires-Dist: whenever>=0.6.9
Requires-Dist: beautifulsoup4>=4.11.1
Requires-Dist: jinja2>3.1.0
Requires-Dist: lark>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: diskcache>=5.6.3
Requires-Dist: ulid-py>=1.1.0
Requires-Dist: prettyprinter>=0.18.0
Requires-Dist: setproctitle>=1.2.2
Requires-Dist: edgartools>=5.30.2
Requires-Dist: yfinance>=1.2.0
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# AlphaMeta

[![PyPI - Version](https://img.shields.io/pypi/v/alphameta)](https://pypi.org/project/alphameta/)
[![Python Version](https://img.shields.io/badge/python-3.12%20%7C%203.13%20%7C%203.14-blue)]()
[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue)]()
[![PyPI - Downloads](https://img.shields.io/pypi/dm/alphameta?label=pypi%20monthly)](https://pypi.org/project/alphameta/)
[![Downloads](https://static.pepy.tech/badge/alphameta)](https://pepy.tech/project/alphameta)
[![WeChat](https://img.shields.io/badge/WeChat-Group-C5EAB4?style=flat&logo=wechat&logoColor=white)](https://github.com/intelliscale/.github)

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

```bash
pip install alphameta
```

Get a **free API key** at [alphameta.app](https://alphameta.app), then create `~/.alphameta/.env`:

```ini
# API Key (Required) — get one free at https://alphameta.app
ALPHAMETA_API_KEY=am-xxx

# IBKR Account ID (Required for trading)
ALPHAMETA_IBKR_ACCOUNT_ID=U1234567

# IBKR Gateway connection
ALPHAMETA_IBKR_HOST=127.0.0.1
ALPHAMETA_IBKR_PORT=4001
ALPHAMETA_IBKR_CLIENT_ID=0

# Timezone (default: US/Eastern)
# ALPHAMETA_TIMEZONE=Asia/Shanghai
```

Start the server:

```bash
alphameta --ibkr
```

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

```bash
# 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": "filings AAPL 10-K"}'
```

Trading also requires a running [IBKR Gateway](https://www.interactivebrokers.com/en/trading/ibgateway-latest.php) or TWS.

## AI Agent Skills

[alphameta-skills](https://github.com/intelliscale/alphameta-skills) provides agent skills for AI coding assistants (Claude Code, Codex, Cursor, etc.) — use AlphaMeta in natural language for market data, trading, portfolio analysis, and more.

```bash
npx skills add intelliscale/alphameta-skills -g
```

## Features

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

## Examples

**Bulk symbol expansion:**
```bash
# 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": "remove :{31..37}"}'
```

**Multi-symbol orders:**
```bash
# 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:**
```bash
# 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:**
```bash
# 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:**
```bash
# 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

© 2026 Intelliscale Technologies, Inc.
