Logo di Yahoo Finance2

Yahoo Finance2

Community
gadicc
yahoo-finance2

Use when building with the yahoo-finance2 TypeScript/Deno/npm library, using its Yahoo Finance data modules, CLI, or MCP server, or contributing to the yahoo-finance2 repository including modules, validation schemas, cached fixtures, and npm/JSR build output.

Panoramica

Pubblicato dagadicc
Repositoryyahoo-finance2
Nome della skillyahoo-finance2
Stelle
802
Fork
107
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da gadicc su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Yahoo Finance2 in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/gadicc/yahoo-finance2/tree/dev/skills/yahoo-finance2
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/gadicc/yahoo-finance2.git /tmp/yahoo-finance2
mkdir -p .claude/skills
cp -r /tmp/yahoo-finance2/skills/yahoo-finance2 .claude/skills/yahoo-finance2
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Yahoo Finance2 in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Yahoo Finance2 non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Yahoo Finance2 non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

yahoo-finance2

What this skill is for

Use this skill when a task involves yahoo-finance2, including:

  • Adding Yahoo Finance market data to a server-side JavaScript/TypeScript app.
  • Choosing between quote, chart, historical, quoteSummary, fundamentalsTimeSeries, screener, options, or other modules.
  • Using the package CLI or bundled MCP server.
  • Modifying this repository's Deno source, tests, generated schemas, docs, or npm output build.

This is an unofficial Yahoo Finance client. Do not describe it as a supported Yahoo API, and do not assume Yahoo data availability, freshness, or shape is guaranteed.

Using the package

Prefer the v3 class API:

ts
import YahooFinance from "yahoo-finance2";

const yahooFinance = new YahooFinance();
const quote = await yahooFinance.quote("AAPL");
console.log(quote?.regularMarketPrice, quote?.currency);

Do not use old v1/v2 singleton patterns such as yahooFinance.setGlobalConfig(). In v3, instantiate with new YahooFinance(options).

This package is for server-side runtimes. Do not put direct Yahoo Finance calls in browser/client bundles; Yahoo's CORS and cookie behavior require a server, serverless, edge, Deno, Bun, or Node context.

Module selection

  • Use search(query) first when a symbol is uncertain.
  • Use quote(symbolOrSymbols) for current or near real-time quote fields. It accepts one symbol or an array. Use fields to limit payloads; for keyed access, request object or map returns.
  • Use quoteCombine(symbol) when many independent code paths need quote data; it debounces many single-symbol calls into fewer quote() requests.
  • Use chart(symbol, { period1, period2, interval }) for chart-ready historical data with events such as dividends and splits. return: "array" is easier to iterate; return: "object" mirrors Yahoo's native shape.
  • Use historical() for a simpler OHLCV history interface.
  • Use quoteSummary(symbol, { modules }) for profile, price, summary detail, filings, ownership, recommendations, and other quote-summary modules. Request only the modules needed.
  • Use fundamentalsTimeSeries() for financial statements. Since late 2024, quote-summary financial-statement modules such as incomeStatementHistory, balanceSheetHistory, and cashflowStatementHistory provide little data.
  • Use options(symbol) for options chains.
  • Use screener() instead of removed/deprecated daily gainers or losers modules. Common predefined screeners include day_gainers, day_losers, and most_actives.
  • Use trendingSymbols(region), recommendationsBySymbol(), and insights() for their specialized Yahoo Finance endpoints.

Reliability, validation, and errors

Wrap module calls in try/catch. Network errors, Yahoo API errors, delisted symbols, missing data, and validation failures are expected operating conditions.

By default, returned data is validated and coerced so known dates become Date objects and known result shapes are safe to consume. If validation fails, fixing the typed interface and regenerated schema is usually better than turning validation off.

Only use { validateResult: false } when the caller accepts unknown output and performs its own checks. Use { validateOptions: false } only when experimenting with Yahoo query parameters that the library does not yet model.

The default client queue limits concurrent Yahoo requests. Use constructor or per-call queue options when you need stricter rate behavior:

ts
const yahooFinance = new YahooFinance({
  queue: { concurrency: 2, interval: 250 },
});

CLI and MCP

For quick shell use:

bash
npx yahoo-finance2 search AMZN
npx yahoo-finance2 quote AAPL
npx yahoo-finance2 quoteSummary NVDA '{"modules":["assetProfile","secFilings"]}'

JSON-looking positional arguments are parsed as JSON. Successful piped output is JSON-safe.

For MCP clients, the package includes a read-only Yahoo Finance MCP server:

bash
npx -y -p yahoo-finance2 yahoo-finance-mcp

See docs/mcp.md for stdio, HTTP, embedded handler, and client registration details.

Contributing in this repository

Read AGENTS.md and CONTRIBUTING.md first. This repo is Deno-first TypeScript; npm output is generated.

Edit source files under src/, not generated files under npm/, unless the task explicitly asks for generated output. Preserve local .ts import extensions.

Public module files usually follow this pattern:

  • Typed query/result interfaces are the source of truth.
  • Files with @yf-schema import their generated .schema.json.
  • Module functions call this._moduleExec() with query defaults, runtime params, optional transforms, result transforms, schema keys, and module options.
  • Overloads distinguish validated results from { validateResult: false }, which returns unknown.

When changing an exported interface in a file marked @yf-schema, run:

bash
deno task schema

If adding a module, wire it through src/modules/index.ts, deno.json exports, docs/README links, README module lists when relevant, tests, and any CLI/MCP exposure only when the module should be user-facing there.

Tests and fixtures

Run all tests with:

bash
deno task test

Run focused tests with:

bash
deno task test src/modules/quote.test.ts

Use deno task test:serial src/modules/quote.test.ts when debugging or limiting live Yahoo request concurrency.

Tests that touch Yahoo HTTP responses should call setupCache() from tests/common.ts. Prefer the existing pattern:

ts
const YahooFinance = createTestYahooFinance({ modules: { quote } });
const yf = new YahooFinance();

describe("quote", () => {
  setupCache();

  it("passes validation", async (t, onFinish) => {
    await yf.quote("AAPL", {}, {
      devel: { id: "quote-AAPL", t, onFinish },
    });
  });
});

Use fixture ids that match the module and scenario. FETCH_DEVEL=nocache forces live network calls. FETCH_DEVEL=recache refreshes cache files for failing tests. Do not recache fixtures ending in .static.json or .fake.json; they are intentionally stable or synthetic.

When fixing validation failures, inspect the validation error path and cached Yahoo response, update the TypeScript interface first, run schema generation, then run the focused test.

Build, lint, and release surface

Use these checks as appropriate:

bash
deno fmt
deno lint
deno task test
deno task build:npm

scripts/build_npm.ts controls the generated npm package metadata, binaries, dependencies, copied files, and package keywords. Keep npm-package changes there unless explicitly regenerating npm/.

Commit messages should use Conventional Commits with a scope, such as fix(quote): handle missing extended market fields.

Agent skill installation

The canonical skill lives at skills/yahoo-finance2/SKILL.md. To install it through the Skills CLI and make it visible to skills.sh telemetry, use:

bash
npx skills add gadicc/yahoo-finance2

Domande frequenti

Cosa fa la skill IA Yahoo Finance2?

Use when building with the yahoo-finance2 TypeScript/Deno/npm library, using its Yahoo Finance data modules, CLI, or MCP server, or contributing to the yahoo-finance2 repository including modules, validation schemas, cached fixtures, and npm/JSR build output.

Perché usare Yahoo Finance2 su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Yahoo Finance2 è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Yahoo Finance2 in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/gadicc/yahoo-finance2/tree/dev/skills/yahoo-finance2. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Yahoo Finance2?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Yahoo Finance2?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Yahoo Finance2: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Yahoo Finance2 è gratuita?

Sì. È pubblicata su GitHub da gadicc con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇