Skip to content
Back to search

yahoo-finance2

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/gadicc/yahoo-finance2 with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/gadicc/yahoo-finance2'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/gadicc--yahoo-finance2/badge.svg)](/listings/gadicc--yahoo-finance2)

HTML

<a href="/listings/gadicc--yahoo-finance2"><img src="/api/listings/gadicc--yahoo-finance2/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**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](./docs/cli.md) for stdout/stderr behavior and exit codes.

See the [MCP docs](./docs/mcp.md) 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`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/chart), [`fundamentalsTimeSeries`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/fundamentalsTimeSeries), [`historical`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/historical), [`insights`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/insights), [`options`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/options), [`quote`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/quote), [`quoteSummary`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/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`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/recommendationsBySymbol), [`screener`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/screener), [`search`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/search), [`trendingSymbols`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/trendingSymbols).

Extras: [`quoteCombine`](https://jsr.io/@gadicc/yahoo-finance2/doc/other/quoteCombine).

See the [Explanatatory Documentation](./docs/README.md) and [Full API Documentation](https://jsr.io/@gadicc/yahoo-finance2/doc/~/default).

Particularly, make sure to read the notes there on [ERROR HANDLING](./docs/README.md#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).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 181 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # yahoo-finance2
  2. Unofficial API for Yahoo Finance with CLI, MCP and Agent Skill.
  3. Copyright (c) 2021 by Gadi Cohen and Pilwon Huh. [MIT licensed](./LICENSE).
  4. [![npm](https://img.shields.io/npm/v/yahoo-finance2)](https://www.npmjs.com/package/yahoo-finance2)
  5. [![CI](https://github.com/gadicc/yahoo-finance2/actions/workflows/tests.yaml/badge.svg?branch=dev)](https://github.com/gadicc/yahoo-finance2/actions/workflows/tests.yaml)
  6. [![coverage](https://img.shields.io/codecov/c/github/gadicc/yahoo-finance2)](https://codecov.io/gh/gadicc/yahoo-finance2)
  7. [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
  8. [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
  9. [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
  10. You are reading the docs for **v4**, the current major version published as
  11. `yahoo-finance2@latest`. For the older **v3 docs**, click
  12. [here](https://github.com/gadicc/yahoo-finance2/tree/3.x). Upgrading? See
  13. [UPGRADING](./docs/UPGRADING.md).
  14. [Live Demo on CodeSandbox](https://codesandbox.io/p/devbox/gxvftx) (Updated
  15. 2024-06-17; NextJS with both RSC and Hook-Relay examples)
  16. NB: Recently **the repo was renamed** from `node-yahoo-finance2` to
  17. `yahoo-finance2`, and the following **branches were named**, `master` to `main`,
  18. and `devel` to `dev`. See [UPGRADING.md#dev](./docs/UPGRADING.md#dev) for the
  19. git commands to update your local installation.
  20. ## Supported runtimes:
  21. - **Bun**: v1+.
  22. - **Cloudflare**: Modern releases, tested in CI via Workers Vitest under
  23. `nodejs_compat`.
  24. - **Deno**: v2+.
  25. - **Node**: v22+; v22 until 2027-04-30, v24 until 2028-04-30. Supported releases
  26. follow the [Node.js release schedule](https://endoflife.date/nodejs).
  27. ## Unofficial API
  28. This project is neither created nor endorsed by Yahoo Inc. Yahoo does not
  29. provide any official API to developers, nor makes any guarantees regarding
  30. service availability or API consistency. In practice however, the open source
  31. community has kept this project (and it's predecessor) working well since 2013.
  32. Nevertheless, we make no guarantees and you use this package at your own risk.
  33. The developers (and obviously Yahoo) cannot be held responsible for any losses
  34. you may incur as a result of using this service. Use of this package is
  35. considered acknowledgement and acceptance of these terms and of its license.
  36. ## Quickstart
  37. **CLI** (Command line interface)
  38. ```bash
  39. $ npx yahoo-finance2 --help
  40. $ npx yahoo-finance2 search AMZN
  41. $ npx yahoo-finance2 quoteSummary GOOGL
  42. $ npx yahoo-finance2 quoteSummary NVDA '{"modules":["assetProfile", "secFilings"]}'
  43. # or install it
  44. $ npm install -g yahoo-finance2
  45. $ yahoo-finance search MSFT '{ "someOption": true }'
  46. ```
  47. See the [CLI docs](./docs/cli.md) for stdout/stderr behavior and exit codes.
  48. See the [MCP docs](./docs/mcp.md) to expose yahoo-finance2 tools to MCP clients
  49. such as Codex, Claude, Cursor, and VS Code.
  50. **Importing**
  51. ```ts
  52. // or: const YahooFinance = require("yahoo-finance2").default;
  53. import YahooFinance from "yahoo-finance2";
  54. const yahooFinance = new YahooFinance();
  55. const results = await yahooFinance.search("Apple");
  56. const quote = await yahooFinance.quote('AAPL');
  57. const { regularMarketPrice as price, currency } = quote;
  58. ```
  59. Available modules:
  60. [`chart`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/chart),
  61. [`fundamentalsTimeSeries`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/fundamentalsTimeSeries),
  62. [`historical`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/historical),
  63. [`insights`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/insights),
  64. [`options`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/options),
  65. [`quote`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/quote),
  66. [`quoteSummary`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/quoteSummary)
  67. (submodules: assetProfile, balanceSheetHistory, balanceSheetHistoryQuarterly,
  68. calendarEvents, cashflowStatementHistory, cashflowStatementHistoryQuarterly,
  69. defaultKeyStatistics, earnings, earningsHistory, earningsTrend, financialData,
  70. fundOwnership, fundPerformance, fundProfile, incomeStatementHistory,
  71. incomeStatementHistoryQuarterly, indexTrend, industryTrend, insiderHolders,
  72. insiderTransactions, institutionOwnership, majorDirectHolders,
  73. majorHoldersBreakdown, netSharePurchaseActivity, price, quoteType,
  74. recommendationTrend, secFilings, sectorTrend, summaryDetail, summaryProfile,
  75. symbol, topHoldings, upgradeDowngradeHistory),
  76. [`recommendationsBySymbol`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/recommendationsBySymbol),
  77. [`screener`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/screener),
  78. [`search`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/search),
  79. [`trendingSymbols`](https://jsr.io/@gadicc/yahoo-finance2/doc/modules/trendingSymbols).
  80. Extras:
  81. [`quoteCombine`](https://jsr.io/@gadicc/yahoo-finance2/doc/other/quoteCombine).
  82. See the [Explanatatory Documentation](./docs/README.md) and
  83. [Full API Documentation](https://jsr.io/@gadicc/yahoo-finance2/doc/~/default).
  84. Particularly, make sure to read the notes there on
  85. [ERROR HANDLING](./docs/README.md#error-handling). Be aware that if a stock gets
  86. delisted, Yahoo removes all related data, including historical (and chart) data
  87. from periods _before_ the delisting occurred (i.e. queries that worked before
  88. will start failing, and there is no way to retrieve this data again).
  89. ## Agent Skill
  90. This repo ships an Agent Skills-compatible skill at
  91. [`skills/yahoo-finance2`](./skills/yahoo-finance2/SKILL.md). Install it for
  92. compatible agents with:
  93. ```bash
  94. npx skills add gadicc/yahoo-finance2
  95. ```
  96. The npm package also includes the skill under `skills/yahoo-finance2` for tools
  97. that sync skills from installed packages.
  98. ## (Optional) TypeScript Love
  99. Working with `yahoo-finance2` is a joy if you're using TypeScript (but you don't
  100. have to), with type checking and auto completion:
  101. ![Types Animation](./docs/img/yf-typescript-demo.gif)
  102. Try it yourself on our
  103. [Live CodeSandbox](https://codesandbox.io/s/yahoo-finance2-312x2?file=/src/index.ts).
  104. ## Using in the Browser
  105. It's not possible to run this in the browser, due to CORS and cookie issues. You
  106. should execute calls on a server or in a serverless or edge function, and pass
  107. this data to the browser as required. See the CodeSandbox above for examples.
  108. Use React Server Components, trpc, or other strategies to maintain types.
  109. ## Related Projects
  110. - 📈 [Ghostfolio](https://ghostfol.io/) - mature, open-source Wealth Management
  111. & longtime supporter.
  112. - 🛠️ [StockQuotes.MCP](https://github.com/lionelschiepers/StockQuotes.MCP) - AI
  113. MCP Server to fetch real time financial data.
  114. - ⚡ [live-quotes](https://github.com/mnsrulz/live-quotes) - Demo to showcase
  115. running yahoo-finance2 in cloudflare workers with live quotes.
  116. - 🦊 [Foliofox](https://www.foliofox.com/) - Open-source portfolio tracker with
  117. an AI financial advisor.
  118. Want your project listed? Open a PR to add it here.
  119. ## Contributing
  120. Pull Requests welcome! Read [CONTRIBUTING.md](./CONTRIBUTING.md) and join our
  121. list of heroes:
  122. <!--
  123. ![contributor-faces](https://contributors-svg.vercel.app/api/svg?user=gadicc&repo=yahoo-finance2)
  124. -->
  125. ![contributors badge](https://readme-contribs.as93.net/contributors/gadicc/yahoo-finance2)
  126. ## Credits
  127. - Massive thanks to [@pilwon](https://github.com/pilwon) for the original
  128. [node-yahoo-finance](https://www.npmjs.com/package/yahoo-finance) and for all
  129. our prior collaborations on this and other projects 🙏
  130. - Special mention goes out to [pudgereyem](https://github.com/pudgereyem) and
  131. [PythonCreator27](https://github.com/PythonCreator27) who made significant
  132. contributions in the very early days of this project.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.