Supacrawler Docs
Use Cases

Real-Time Stock Market News Monitoring

Monitor financial news for key trading events and market-moving information. Track financial news sources for market-moving events, earnings announcements, and trading signals.

APIs Used: Scrape API for extracting news articles and Watch API for real-time monitoring of financial news sources.

Quick Example

import requests
import os

financial_sources = [
    {"name": "Bloomberg", "url": "https://www.bloomberg.com/markets", "selector": ".story-list-story__info__headline"},
    {"name": "Reuters", "url": "https://www.reuters.com/markets/", "selector": ".story-card__headline"},
    {"name": "WSJ", "url": "https://www.wsj.com/news/markets", "selector": ".WSJTheme--headline--"}
]

for source in financial_sources:
    requests.post("https://api.supacrawler.com/api/v1/watch",
        headers={"Authorization": f"Bearer {os.environ['SUPACRAWLER_API_KEY']}"},
        json={
            "url": source["url"],
            "frequency": "hourly",
            "selector": source["selector"],
            "notify_email": "[email protected]",
            "webhook_url": "https://your-api.com/market-alerts",
            "webhook_headers": {"X-Source": source["name"]}
        }
    )

Company-Specific Monitoring

from supacrawler import SupacrawlerClient

client = SupacrawlerClient(api_key=os.environ['SUPACRAWLER_API_KEY'])

# Monitor specific company news
def monitor_company(ticker, company_name):
    search_url = f"https://finance.yahoo.com/quote/{ticker}/news"
    
    response = requests.post("https://api.supacrawler.com/api/v1/watch",
        headers={"Authorization": f"Bearer {os.environ['SUPACRAWLER_API_KEY']}"},
        json={
            "url": search_url,
            "frequency": "hourly",
            "selector": "h3.Mb\\(5px\\)",
            "notify_email": f"{ticker.lower()}[email protected]",
            "webhook_url": "https://your-api.com/stock-alerts",
            "webhook_headers": {"X-Ticker": ticker, "X-Company": company_name}
        }
    )
    
    return response.json()

# Monitor portfolio
portfolio = [
    ("AAPL", "Apple"),
    ("MSFT", "Microsoft"),
    ("GOOGL", "Google")
]

for ticker, name in portfolio:
    result = monitor_company(ticker, name)
    print(f"✅ Monitoring {name} ({ticker})")

Earnings Calendar

# Monitor earnings announcements
result = client.scrape("https://finance.yahoo.com/calendar/earnings", format="markdown")

import re
earnings_dates = re.findall(r'\d{2}/\d{2}/\d{4}', result.content)
print(f"Upcoming earnings: {len(earnings_dates)} companies")

Best Practices

  • Hourly monitoring for breaking news
  • Multiple sources for comprehensive coverage
  • Webhook integration for real-time trading alerts
  • Keyword filtering for relevant tickers
  • Historical archiving for pattern analysis
  • Sentiment analysis with AI post-processing

Was this page helpful?