AI代理数据API

GroundAPI为AI代理提供统一的数据层,涵盖金融、信息和生活服务三大领域的11种工具,支持REST API、MCP和CLI三种访问方式。

  • by qingkongzhiqian
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 qingkongzhiqian/groundapi

使用说明

GroundAPI

Data API for AI Agents

Website · Docs · MCP Endpoint · CLI

中文 | English


GroundAPI为AI代理提供了一个统一的数据层-- 11工具 涵盖金融、信息和生活服务。一个API密钥,三种访问方法: REST API, 主控程序,以及 命令行界面.

目录

快速开始

获取API密钥: groundapi.net — 500个免费电话/月,不需要信用卡。

选项1:MCP(推荐用于AI代理)

添加到Claude Desktop、Cursor、Windsurf或任何兼容MCP的客户端:

{
  "mcpServers": {
    "groundapi": {
      "url": "https://mcp.groundapi.net/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

选项2:REST API

curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.groundapi.net/v1/finance/stock?symbol=600519&aspects=overview"

选项3:CLI

pip install groundapi-cli
groundapi config set-key YOUR_API_KEY
groundapi stock --symbol 600519

MCP工具参考

金融(5种工具)

finance_stock --证券数据

A股股票、指数和ETF的多功能查询。支持 11个数据维度 以及多股票比较。

参数 类型 默认值 说明
symbol string -- 股票代码。逗号分隔用于比较(例如。 "600519,000858")
keyword string -- 按名称搜索(例如。 "茅台")
aspects 字符串 "overview" 数据维度,逗号分隔(见下表)
days int 60 kline/技术的历史范围
period 字符串 "d" K线周期: 5/15/30/60/d/w/m

11个可用方面:

Aspect 返回 使用时间
overview 快速快照:报价+简介+财务简报 “XXXX怎么样?”
profile 完整的公司信息、概念、索引成员、资本结构 “这家公司做什么?”
quote 最新收盘价,市盈率,涨跌距离限制 “当前价格?”
kline K线数据(支持5/15/30/60min、每日、每周、每月) “显示图表”
technical MACD、MA、BOLL、KDJ+信号检测(例如“DIF越过DEA”) “技术分析?”
financial 3份财务报表、季度损益表、现金流、股息、预测 “财务状况如何?”
holders 前10名股东、持股人、统计趋势、基金持有量 “谁是主要股东?”
management 高管、董事、监事 “谁是管理层?”
events 股息、股票发行、锁定期届满、收益日历 “下一次股息是什么时候?”
summary 多维事实汇总(无意见) “给我一份完整的数据摘要”
peers 同行业比较表,PE/PB/市值排名 “它在行业中排名如何?”
# Quick overview
finance_stock(symbol="600519")

# Deep dive with multiple aspects
finance_stock(symbol="600519", aspects="quote,technical,financial")

# Search by name
finance_stock(keyword="平安")

# Compare multiple stocks
finance_stock(symbol="601398,601939,600036", aspects="quote")

# Index / ETF
finance_stock(symbol="000001.SH", aspects="kline,technical")  # SSE Composite
finance_stock(symbol="510300", aspects="quote")                # CSI 300 ETF

finance_market --市场概况

全市场数据:主要指数、热门股票、行业轮换、IPO日历、异常信号。

参数 类型 默认值 说明
scope 字符串 "overview" 数据范围,逗号分隔
sector string -- 深入特定扇区
date string -- 日期筛选器(YYYY-MM-DD)

范围: overview (指数+情绪)· hot (限制涨跌池,连胜)· sectors (概念和行业列表)· ipo (IPO日历)· signals (异常检测)

finance_market()                                    # Today's market
finance_market(scope="hot")                         # Limit-up/down stocks
finance_market(scope="sectors", sector="AI")        # AI sector constituents
finance_market(scope="ipo")                         # IPO calendar

finance_screen --股票筛选器

具有20多个维度和预设过滤器组合的多标准筛选。

参数 类型 说明
industry string 行业筛选器(例如。 "银行", "半导体")
concept string 概念过滤器(例如。 "AI", "新能源")
pe_max / pe_min 浮动 PE比率范围
pb_max float 最大PB比率
min_market_cap / max_market_cap 浮动 市值范围
min_dividend_yield 浮动 最低股息收益率(%)
filter_preset 字符串 low_pe_high_div · small_cap_growth · large_cap_stable
sort_by string 排序字段(默认值: change_pct)
finance_screen(industry="银行", pe_max=10)                       # Low-PE bank stocks
finance_screen(min_dividend_yield=3, sort_by="dividend_yield")   # High dividend
finance_screen(concept="AI")                                      # AI concept stocks
finance_screen(filter_preset="low_pe_high_div")                  # Preset: value picks

finance_search --通用搜索

搜索范围 11780+证券:股票、概念、行业、ETF、指数。

参数 类型 说明
keyword string 搜索查询
type 字符串 all · stock (6,104) · concept (2,222) · sector (1,466) · etf (1,377) · index (613)
finance_search(keyword="芯片", type="etf")        # Chip ETFs
finance_search(keyword="AI", type="concept")       # AI concept indices
finance_search(keyword="沪深300", type="index")    # CSI 300

finance_gold_price --贵金属

finance_gold_price()   # Gold, silver, platinum prices

信息(4个工具)

info_search --网络搜索

参数 类型 说明
query string 搜索关键字
count int 结果数(1-50,默认值10)
recency 字符串 noLimit · oneDay · oneWeek · oneMonth · oneYear
info_search(query="AI Agent trends 2026", count=20, recency="oneWeek")

info_news --新闻头条

参数 类型 说明
category 字符串 finance · general · tech · sports ...
limit int 文章数量(1-50)
info_news(category="finance", limit=10)
info_news(category="tech")

info_trending --热门话题

微博、抖音、知乎等热门搜索排名。

info_trending()

info_bulletin --每日简报

info_bulletin()   # Morning news digest

生活服务(2个工具)

life_weather --天气

参数 类型 说明
city string 城市名称(例如。 "Beijing")
location string Lat,lng(例如。 "39.9,116.4")
forecast bool 包括7天预测
life_weather(city="北京", forecast=True)
life_weather(location="39.9,116.4")

life_calendar --日历和交易日

life_calendar()                  # Today: lunar date, solar terms, holiday, trading day
life_calendar(date="2026-05-01") # Specific date

REST API

基本URL: https://api.groundapi.net

所有端点都需要 X-API-Key 头球

端点 描述
GET /v1/finance/stock 股票/指数/ETF数据
GET /v1/finance/stock/screen 库存筛选
GET /v1/finance/market 市场概况
GET /v1/finance/search 证券查询
GET /v1/finance/gold-price 黄金和贵金属
GET /v1/info/search 网络搜索
GET /v1/info/news 新闻头条
GET /v1/info/trending 热门话题
GET /v1/info/bulletin 每日简报
GET /v1/life/weather 天气
GET /v1/life/calendar 日历信息
# Stock overview
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.groundapi.net/v1/finance/stock?symbol=600519&aspects=overview"

# Multi-aspect deep dive
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.groundapi.net/v1/finance/stock?symbol=600519&aspects=quote,technical,financial"

# Market overview
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.groundapi.net/v1/finance/market?scope=overview"

# Stock screening
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.groundapi.net/v1/finance/stock/screen?industry=银行&pe_max=10"

# Web search
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.groundapi.net/v1/info/search?q=AI+Agent&count=10"

# Weather
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.groundapi.net/v1/life/weather?city=北京&forecast=true"

API完整文档: docs.groundapi.net


CLI参考

安装

pip install groundapi-cli
groundapi config set-key YOUR_API_KEY

金融

# Stock quotes
groundapi stock --symbol 600519                            # Latest quote
groundapi stock --keyword 贵州茅台                          # Search by name
groundapi stock --symbol 600519 --date 2024-12-31          # Specific date
groundapi stock --symbol 600519 --days 30                  # Last 30 days
groundapi stock --symbol 600519 --days 30 --include technicals  # With technicals

# Screening
groundapi screen                                           # Default ranking
groundapi screen --industry 白酒 --pe-max 30               # Industry + PE filter
groundapi screen --sort-by total_market_cap --limit 10     # Top 10 by market cap

# Market overview
groundapi market                                           # Indices + macro
groundapi market --include sectors,valuation               # With sectors + valuation
groundapi market --sector 半导体 --type industry           # Sector drill-down

# Finance search
groundapi fsearch 芯片                                     # Search securities
groundapi fsearch AI --type concept                        # AI concept indices

# Gold price
groundapi gold                                             # Precious metals prices

信息

groundapi search "AI Agent"                                # Web search
groundapi search "AI Agent" --count 20 --recency oneWeek   # With filters
groundapi news                                             # Finance news
groundapi news --category tech --limit 10                  # Tech news
groundapi trending                                         # Trending topics
groundapi bulletin                                         # Daily briefing

生活服务

groundapi weather --city 北京                               # Current weather
groundapi weather --city 北京 --forecast                    # 7-day forecast
groundapi weather --location 39.9,116.4                    # By coordinates
groundapi calendar                                         # Today's calendar info

代理技能

将GroundAPI工具结合到自动化工作流程中的预构建技能。在Cursor、OpenClaw或Smithery中安装:

技能 描述
市场简报 生成每日A股市场摘要——指数、行业、热门股票、异常
A股分析师 11个数据维度的深度分析——输出包含技术和财务的结构化报告
股票筛选器 自然语言股票筛选——“发现被低估的高股息银行股”
上下文感知 每日助理——天气、日历、新闻一次完成
异常跟踪器 市场异常检测——异常交易量、价差、涨停

自托管MCP服务器

在本地运行MCP服务器(本地AI客户端的stdio传输):

pip install -r requirements.txt
python mcp_server.py

或者连接到托管的MCP端点(无需部署):

https://mcp.groundapi.net/mcp

定价

免费 付费
呼叫 500/月 现收现付
速率限制 60分钟 300分钟
支付 -- 支付宝/微信支付/信用卡

获取API密钥: groundapi.net.

链接

许可证

MIT——仅提供技能、MCP服务器包装和文档。GroundAPI是一种商业API服务。