Metadata-Version: 2.2
Name: groundapi-cli
Version: 3.2.0
Summary: GroundAPI CLI — Real-time Data API for AI Agents
Project-URL: Homepage, https://groundapi.net
Project-URL: Documentation, https://groundapi.net/documentation
Keywords: groundapi,cli,api,ai-agent,real-time-data
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.28.0
Requires-Dist: typer>=0.15.0
Requires-Dist: rich>=13.9.0

# GroundAPI CLI

专为 AI Agent 设计的实时数据命令行工具。一个 API Key，在终端查询 A 股行情、股票筛选、大盘数据、基金、天气、快递、搜索、网页抓取、新闻、IP 定位。

## 安装

```bash
pip install groundapi-cli
```

## 配置

```bash
groundapi config set-key sk_gapi_你的密钥
```

或使用环境变量：

```bash
export GROUNDAPI_API_KEY=sk_gapi_你的密钥
```

## 使用

### 金融

```bash
# A 股行情
groundapi stock --symbol 600519                          # 实时行情
groundapi stock --keyword 贵州茅台                        # 搜索股票
groundapi stock --symbol 600519 --date 2024-12-31        # 指定日期日K
groundapi stock --symbol 600519 --days 30                # 最近30天历史
groundapi stock --symbol 600519 --days 30 --include technicals  # 历史+技术指标

# 股票筛选与排行
groundapi screen                                         # 默认排行 (涨跌幅)
groundapi screen --industry 白酒 --pe-max 30             # 按行业+PE筛选
groundapi screen --sort-by total_market_cap --limit 10   # 市值前10

# 大盘总览
groundapi market                                         # 大盘+宏观
groundapi market --include sectors,valuation             # 附带板块+估值
groundapi market --sector 半导体 --type industry         # 板块详情

# 基金
groundapi fund                                           # 基金排行
groundapi fund --keyword 沪深300                          # 搜索基金
groundapi fund --code 110011                             # 基金详情
```

### 资讯

```bash
groundapi search "AI Agent"                              # 网络搜索
groundapi search "AI Agent" --count 20 --recency oneWeek # 限定时间范围
groundapi scrape https://example.com                     # 网页抓取
groundapi news                                           # 财经新闻
groundapi news --category tech --limit 10                # 科技新闻
```

### 生活

```bash
groundapi weather --city 北京                             # 实时天气
groundapi weather --city 北京 --forecast                  # 含7天预报
groundapi weather --location 39.9,116.4                  # 经纬度查询
groundapi logistics SF1234567890                         # 快递追踪
groundapi ip 8.8.8.8                                     # IP 定位
```

## 获取 API Key

前往 [groundapi.net](https://groundapi.net) 注册，每月 500 次免费调用。
