Zum Inhalt springen
Skillpedia
APIs & Server (Backend)7.8k · #13054

finnhub-stock-api

Was er macht

Dieser Skill erklärt, wie der Agent die Finnhub-Aktendaten-API aufrufen kann. Er richtet sich an Entwickler, die Dashboards oder Werkzeuge bauen, die Aktienkurse und Unternehmensdetails zeigen.

Wann du ihn nutzt

  • ✓Wenn du Live-Aktienkurse in einer App oder einem Dashboard anzeigen willst.
  • ✓Wenn du ein Unternehmensprofil brauchst, etwa Name, Börse und Logo.
  • ✓Wenn du historische Kursdaten für Diagramme oder Analysen willst.

Link zum Skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/finnhub-stock-api/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/finnhub-stock-api/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Füge meinem Dashboard einen Live-Aktienkurs und das Unternehmensprofil für AAPL hinzu, über die Finnhub-API.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent ruft die Finnhub-Endpunkte mit einem API-Schlüssel in der Abfrage auf. Er kann den aktuellen Kurs, das Unternehmensprofil oder historische Kerzen abrufen und hält das Limit der kostenlosen Stufe von 60 Anfragen pro Minute ein.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Finnhub Stock API Integration

Finnhub provides free stock market data (REST + WebSocket). API key required (free tier: 60 calls/min).

  • Docs: https://finnhub.io/docs/api
  • Base URL: https://finnhub.io/api/v1
  • Auth: Query param token=YOUR_API_KEY
  • Rate limit: 60 requests/minute (free), 300/min (premium)
  • CORS: Unknown (use server-side proxy)

Key Endpoints

1. Stock Quote (Real-Time)

GET /quote?symbol=AAPL&token=API_KEY

Response:

{
  "c": 178.72,     // Current price
  "d": 2.38,       // Change (absolute)
  "dp": 1.35,      // Change percent
  "h": 179.60,     // High price of the day
  "l": 175.10,     // Low price of the day
  "o": 176.15,     // Open price
  "pc": 176.34,    // Previous close
  "t": 1702569600  // Timestamp
}

2. Company Profile

GET /stock/profile2?symbol=AAPL&token=API_KEY

Response:

{
  "country": "US",
  "currency": "USD",
  "exchange": "NASDAQ NMS - GLOBAL MARKET",
  "name": "Apple Inc",
  "ticker": "AAPL",
  "ipo": "1980-12-12",
  "marketCapitalization": 2794000,
  "logo": "https://static.finnhub.io/logo/..."
}

3. Stock Candles (Historical)

GET /stock/candle?symbol=AAPL&resolution=D&from=1609459200&to=1640995200&token=API_KEY
  • resolution: 1, 5, 15, 30, 60, D, W, M
  • from / to: UNIX timestamps

Response:

{
  "c": [130.21, 131.96, ...],  // Close prices
  "h": [131.74, 132.63, ...],  // Highs
  "l": [128.50, 130.23, ...],  // Lows
  "o": [130.92, 130.87, ...],  // Opens
  "v": [143301900, ...],       // Volumes
  "t": [1609459200, ...],      // Timestamps
  "s": "ok"                     // Status
}

4. Market News

GET /news?category=general&token=API_KEY

Categories: general, forex, crypto, merger

Frontend Service Implementation

// src/services/stock-market.ts
import { createCircuitBreaker } from '@/utils/circuit-breaker';

export interface StockQuote {
  symbol: string;
  name: string;
  price: number | null;
  change: number | null;
  changePercent: number | null;
  high: number | null;
  low: number | null;
  sparkline?: number[];
}

const quoteBreaker = createCircuitBreaker<StockQuote[]>({
  name: 'StockQuotes',
  cacheTtlMs: 30_000,
});

const DEFAULT_SYMBOLS = ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'TSLA', 'NVDA', 'META'];

export async function fetchStockQuotes(symbols = DEFAULT_SYMBOLS): Promise<StockQuote[]> {
  return quoteBreaker.execute(async () => {
    const resp = await fetch(`/api/stocks?symbols=${symbols.join(',')}`);
    if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
    const data = await resp.json();
    return data.quotes.map((q: any) => ({
      symbol: q.symbol,
      name: q.name || q.symbol,
      price: q.price ?? q.c ?? null,
      change: q.change ?? q.d ?? null,
      changePercent: q.changePercent ?? q.dp ?? null,
      high: q.high ?? q.h ?? null,
      low: q.low ?? q.l ?? null,
    }));
  }, []);
}

Alternative APIs (from public-apis)

If Finnhub rate limits are a concern, these alternatives are available:

API Free Tier Notes
Alpha Vantage 25 req/day (free) https://www.alphavantage.co/
Twelve Data 800 req/day https://twelvedata.com/
Financial Modeling Prep 250 req/day https://financialmodelingprep.com/
Yahoo Finance (via RapidAPI) Varies https://www.yahoofinanceapi.com/
Polygon 5 req/min (free) https://polygon.io/
IEX Cloud 50k credits/month https://iexcloud.io/
Marketstack 100 req/month https://marketstack.com/

Server-Side Proxy

The frontend should never call Finnhub directly. Use the API proxy pattern (see api-proxy-endpoint skill) to:

  1. Hide the API key
  2. Batch multiple symbol requests
  3. Add edge caching (30s Cache-Control)
  4. Handle rate limit errors gracefully (return cached data)
Häufige Fragen

Braucht Finnhub einen API-Schlüssel?

Ja, der Skill sagt, ein API-Schlüssel ist nötig und wird als Token in der Anfrage übergeben.

Wie hoch ist das kostenlose Limit?

Der Skill nennt 60 Anfragen pro Minute in der kostenlosen Stufe und 300 in der Premium-Stufe.

Darf der Schlüssel im Browser genutzt werden?

Der Skill weist darauf hin, dass CORS unbekannt ist, und schlägt daher einen serverseitigen Proxy vor.

Details

Originalbeschreibung des Autors

Integrate with Finnhub Stock API for real-time and historical stock market data. Covers quote fetching, company profiles, and WebSocket streaming.

repo: HKUDS/AgentPilot

Beliebtheit

GitHub-Sterne
7.8k
Platz im Ranking
#13054
Lizenz
MIT
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills