Financial Data Fetcher

From gracefullight/stock-checker · View interactive version

Financial Data Fetcher is an AI agent skill from the GitHub repository gracefullight/stock-checker. Fetches real-time and historical market data, financial news, and fundamental data for trading decisions

How to use this skill

Skill file

Financial Data Fetcher Skill

Provides comprehensive market data access for AI trading agents.

Overview

This skill fetches:

Tools

1. get_price_data

Fetches historical or real-time price data for symbols.

Parameters:

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

2. get_latest_news

Fetches recent financial news for symbols.

Parameters:

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"
    }
  ]
}

3. get_fundamentals

Fetches fundamental data for symbols.

Parameters:

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
    }
  }
}

4. get_market_snapshot

Gets current market snapshot with real-time quotes.

Parameters:

Returns:

{
  "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
    }
  }
}

Implementation

See scripts/fetch_data.py for full implementation using Alpaca API and yfinance.

Rate Limiting

Error Handling

All tools return consistent error format:

{
  "success": false,
  "error": "Error message",
  "error_code": "INVALID_SYMBOL"
}

Integration Example

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
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.