Financial Data Fetcher by gracefullight/stock-checker
npx skills add https://github.com/gracefullight/stock-checker --skill 'Financial Data Fetcher'为 AI 交易代理提供全面的市场数据访问。
此技能获取:
获取指定代码的历史或实时价格数据。
参数:
symbols (必填): 股票代码列表 (例如:["AAPL", "MSFT"])timeframe (可选): "1Min", "5Min", "1Hour", "1Day" (默认:"1Day")start_date (可选): 开始日期,格式为 YYYY-MM-DDend_date (可选): 结束日期,格式为 YYYY-MM-DDlimit (可选): 要获取的 K 线数量 (默认:100)返回:
{
"success": true,
"data": {
"AAPL": [
{
"timestamp": "2025-10-30T09:30:00Z",
"open": 150.25,
"high": 151.50,
"low": 149.80,
"close": 151.00,
"volume": 5000000
}
]
}
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
用法:
python scripts/fetch_data.py get_price_data --symbols AAPL MSFT --timeframe 1Day --limit 30
获取指定代码的最新金融新闻。
参数:
symbols (必填): 股票代码列表limit (可选): 新闻条数 (默认:10)sources (可选): 要查询的新闻来源 (默认:全部)返回:
{
"success": true,
"data": [
{
"symbol": "AAPL",
"headline": "Apple announces new product line",
"summary": "...",
"source": "Bloomberg",
"url": "https://...",
"published_at": "2025-10-30T08:00:00Z",
"sentiment": "positive"
}
]
}
获取指定代码的基本面数据。
参数:
symbols (必填): 股票代码列表metrics (可选): 要获取的特定指标 (默认:全部)返回:
{
"success": true,
"data": {
"AAPL": {
"market_cap": 3000000000000,
"pe_ratio": 28.5,
"eps": 6.42,
"dividend_yield": 0.52,
"beta": 1.2,
"52_week_high": 200.00,
"52_week_low": 120.00
}
}
}
获取包含实时报价的当前市场快照。
参数:
symbols (必填): 股票代码列表返回:
{
"success": true,
"data": {
"AAPL": {
"price": 151.00,
"bid": 150.98,
"ask": 151.02,
"bid_size": 100,
"ask_size": 200,
"last_trade_time": "2025-10-30T15:59:59Z",
"volume": 50000000,
"vwap": 150.75
}
}
}
完整实现请参见 scripts/fetch_data.py,它使用了 Alpaca API 和 yfinance。
所有工具返回一致的错误格式:
{
"success": false,
"error": "错误信息",
"error_code": "INVALID_SYMBOL"
}
from claude_skills import load_skill
skill = load_skill("financial_data_fetcher")
# 获取价格数据
result = skill.get_price_data(
symbols=["AAPL", "MSFT"],
timeframe="1Day",
limit=30
)
if result["success"]:
prices = result["data"]
# 在交易策略中使用
每周安装次数
–
代码仓库
GitHub 星标数
12
首次出现时间
–
安全审计
Provides comprehensive market data access for AI trading agents.
This skill fetches:
Fetches historical or real-time price data for symbols.
Parameters:
symbols (required): List of ticker symbols (e.g., ["AAPL", "MSFT"])timeframe (optional): "1Min", "5Min", "1Hour", "1Day" (default: "1Day")start_date (optional): Start date in YYYY-MM-DD formatend_date (optional): End date in YYYY-MM-DD formatlimit (optional): Number of bars to fetch (default: 100)Returns:
{
"success": true,
"data": {
"AAPL": [
{
"timestamp": "2025-10-30T09:30:00Z",
"open": 150.25,
"high": 151.50,
"low": 149.80,
"close": 151.00,
"volume": 5000000
}
]
}
}
Usage:
python scripts/fetch_data.py get_price_data --symbols AAPL MSFT --timeframe 1Day --limit 30
Fetches recent financial news for symbols.
Parameters:
symbols (required): List of ticker symbolslimit (optional): Number of news items (default: 10)sources (optional): News sources to query (default: all)Returns:
{
"success": true,
"data": [
{
"symbol": "AAPL",
"headline": "Apple announces new product line",
"summary": "...",
"source": "Bloomberg",
"url": "https://...",
"published_at": "2025-10-30T08:00:00Z",
"sentiment": "positive"
}
]
}
Fetches fundamental data for symbols.
Parameters:
symbols (required): List of ticker symbolsmetrics (optional): Specific metrics to fetch (default: all)Returns:
{
"success": true,
"data": {
"AAPL": {
"market_cap": 3000000000000,
"pe_ratio": 28.5,
"eps": 6.42,
"dividend_yield": 0.52,
"beta": 1.2,
"52_week_high": 200.00,
"52_week_low": 120.00
}
}
}
Gets current market snapshot with real-time quotes.
Parameters:
symbols (required): List of ticker symbolsReturns:
{
"success": true,
"data": {
"AAPL": {
"price": 151.00,
"bid": 150.98,
"ask": 151.02,
"bid_size": 100,
"ask_size": 200,
"last_trade_time": "2025-10-30T15:59:59Z",
"volume": 50000000,
"vwap": 150.75
}
}
}
See scripts/fetch_data.py for full implementation using Alpaca API and yfinance.
All tools return consistent error format:
{
"success": false,
"error": "Error message",
"error_code": "INVALID_SYMBOL"
}
from claude_skills import load_skill
skill = load_skill("financial_data_fetcher")
# Get price data
result = skill.get_price_data(
symbols=["AAPL", "MSFT"],
timeframe="1Day",
limit=30
)
if result["success"]:
prices = result["data"]
# Use in trading strategy
Weekly Installs
–
Repository
GitHub Stars
12
First Seen
–
Security Audits
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
57,000 周安装