Yahoo Finance2 logo

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.

Overview

Publishergadicc
Repositoryyahoo-finance2
Skill nameyahoo-finance2
Stars
802
Forks
107
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by gadicc on GitHub. Read the source before you install it.

Installation

Install the Yahoo Finance2 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/gadicc/yahoo-finance2/tree/dev/skills/yahoo-finance2
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Yahoo Finance2 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Yahoo Finance2 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Yahoo Finance2 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Frequently asked questions

What does the Yahoo Finance2 AI skill do?

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.

Why use Yahoo Finance2 on TypingMind?

Because you install it once and use it with any model. Yahoo Finance2 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Yahoo Finance2 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/gadicc/yahoo-finance2/tree/dev/skills/yahoo-finance2. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Yahoo Finance2?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Yahoo Finance2?

As many as you like. As long as a model supports skills, you can use Yahoo Finance2 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Yahoo Finance2 AI skill free?

Yes. It is published on GitHub by gadicc under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇