yahoo-finance2

作者 gadicc已验证

Unofficial API for Yahoo Finance with CLI, MCP and Agent Skill

785
Stars
106
Forks
HTML
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/gadicc/yahoo-finance2

快速入门

使用 yahoo-finance2 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

yahoo-finance2

Unofficial API for Yahoo Finance with CLI, MCP and Agent Skill.

Copyright (c) 2021 by Gadi Cohen and Pilwon Huh. MIT licensed.

npm CI coverage semantic-release TypeScript MIT License

You are reading the docs for v4, the current major version published as yahoo-finance2@latest. For the older v3 docs, click here. Upgrading? See UPGRADING.

Live Demo on CodeSandbox (Updated 2024-06-17; NextJS with both RSC and Hook-Relay examples)

NB: Recently the repo was renamed from node-yahoo-finance2 to yahoo-finance2, and the following branches were named, master to main, and devel to dev. See UPGRADING.md#dev for the git commands to update your local installation.

Supported runtimes:

  • Bun: v1+.
  • Cloudflare: Modern releases, tested in CI via Workers Vitest under nodejs_compat.
  • Deno: v2+.
  • Node: v22+; v22 until 2027-04-30, v24 until 2028-04-30. Supported releases follow the Node.js release schedule.

Unofficial API

This project is neither created nor endorsed by Yahoo Inc. Yahoo does not provide any official API to developers, nor makes any guarantees regarding service availability or API consistency. In practice however, the open source community has kept this project (and it's predecessor) working well since 2013.

Nevertheless, we make no guarantees and you use this package at your own risk. The developers (and obviously Yahoo) cannot be held responsible for any losses you may incur as a result of using this service. Use of this package is considered acknowledgement and acceptance of these terms and of its license.

Quickstart

CLI (Command line interface)

$ npx yahoo-finance2 --help
$ npx yahoo-finance2 search AMZN
$ npx yahoo-finance2 quoteSummary GOOGL
$ npx yahoo-finance2 quoteSummary NVDA '{"modules":["assetProfile", "secFilings"]}'

# or install it
$ npm install -g yahoo-finance2
$ yahoo-finance search MSFT '{ "someOption": true }'

See the CLI docs for stdout/stderr behavior and exit codes.

See the MCP docs to expose yahoo-finance2 tools to MCP clients such as Codex, Claude, Cursor, and VS Code.

Importing

// or: const YahooFinance = require("yahoo-finance2").default;
import YahooFinance from "yahoo-finance2";

const yahooFinance = new YahooFinance();

const results = await yahooFinance.search("Apple");

const quote = await yahooFinance.quote('AAPL');
const { regularMarketPrice as price, currency } = quote;

Available modules: chart, fundamentalsTimeSeries, historical, insights, options, quote, quoteSummary (submodules: assetProfile, balanceSheetHistory, balanceSheetHistoryQuarterly, calendarEvents, cashflowStatementHistory, cashflowStatementHistoryQuarterly, defaultKeyStatistics, earnings, earningsHistory, earningsTrend, financialData, fundOwnership, fundPerformance, fundProfile, incomeStatementHistory, incomeStatementHistoryQuarterly, indexTrend, industryTrend, insiderHolders, insiderTransactions, institutionOwnership, majorDirectHolders, majorHoldersBreakdown, netSharePurchaseActivity, price, quoteType, recommendationTrend, secFilings, sectorTrend, summaryDetail, summaryProfile, symbol, topHoldings, upgradeDowngradeHistory), recommendationsBySymbol, screener, search, trendingSymbols.

Extras: quoteCombine.

See the Explanatatory Documentation and Full API Documentation.

Particularly, make sure to read the notes there on ERROR HANDLING. Be aware that if a stock gets delisted, Yahoo removes all related data, including historical (and chart) data from periods before the delisting occurred (i.e. queries that worked before will start failing, and there is no way to retrieve this data again).

Agent Skill

This repo ships an Agent Skills-compatible skill at skills/yahoo-finance2. Install it for compatible agents with:

npx skills add gadicc/yahoo-finance2

The npm package also includes the skill under skills/yahoo-finance2 for tools that sync skills from installed packages.

(Optional) TypeScript Love

Working with yahoo-finance2 is a joy if you're using TypeScript (but you don't have to), with type checking and auto completion:

Types Animation

Try it yourself on our Live CodeSandbox.

Using in the Browser

It's not possible to run this in the browser, due to CORS and cookie issues. You should execute calls on a server or in a serverless or edge function, and pass this data to the browser as required. See the CodeSandbox above for examples. Use React Server Components, trpc, or other strategies to maintain types.

Related Projects

  • 📈 Ghostfolio - mature, open-source Wealth Management & longtime supporter.

  • 🛠️ StockQuotes.MCP - AI MCP Server to fetch real time financial data.

  • live-quotes - Demo to showcase running yahoo-finance2 in cloudflare workers with live quotes.

  • 🦊 Foliofox - Open-source portfolio tracker with an AI financial advisor.

Want your project listed? Open a PR to add it here.

Contributing

Pull Requests welcome! Read CONTRIBUTING.md and join our list of heroes:

contributors badge

Credits

  • Massive thanks to @pilwon for the original node-yahoo-finance and for all our prior collaborations on this and other projects 🙏

  • Special mention goes out to pudgereyem and PythonCreator27 who made significant contributions in the very early days of this project.

常见问题

What is yahoo-finance2?

yahoo-finance2 is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by gadicc. Unofficial API for Yahoo Finance with CLI, MCP and Agent Skill. It has 785 GitHub stars.

Is yahoo-finance2 safe to use?

Yes. yahoo-finance2 passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install yahoo-finance2?

Clone the repository with "git clone https://github.com/gadicc/yahoo-finance2" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is yahoo-finance2 written in?

yahoo-finance2 is primarily written in HTML. It is open-source under gadicc on GitHub, so you can review or fork the full source.

Are there alternatives to yahoo-finance2?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh yahoo-finance2 against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情