Registry / http-networking / yahooquery

yahooquery

JSON →
library2.4.1pypypi✓ verified 84d ago

Python wrapper for an unofficial Yahoo Finance API. Provides access to stock fundamentals, historical prices, financial data, and more via REST endpoints. Current version: 2.4.1. Release cadence: irregular.

pip install yahooquery
INSTALL
IMPORT
SIG · YAHOOQUERY
Y
yahooquery
http-networkingpythonv2.4.1
Install
10.5s avg
Import
2117ms
Disk
224MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.216s · 229.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 10.5s · import 2.018s · 219MB
224MB installed
● package 224MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Ticker
from yahooquery import Ticker
from yahoo_finance import Ticker
Various other Yahoo Finance libraries have different import paths.
Search
from yahooquery import Search

Create a Ticker object and fetch current price.

from yahooquery import Ticker ticker = Ticker('AAPL') print(ticker.price)
Debug
Known issues
deprecatedThe `get_historical` method is deprecated; use `history` instead.
fix
Replace .get_historical(period='1y') with .history(period='1y')
affects: >=2.0.0
gotchaYahoo Finance API endpoints change frequently. Some methods may break without notice.
fix
Always check for updates and test your scripts regularly.
affects: all
gotchaRate limiting is not documented. Making too many requests in a short time may result in temporary IP blocks.
fix
Insert delays between requests (e.g., time.sleep(1)).
affects: all
Errors
Common errors & fixes
AttributeError: module 'yahooquery' has no attribute 'Ticker'
Incorrect import: using `import yahooquery` instead of `from yahooquery import Ticker`
fix
Use `from yahooquery import Ticker`
TypeError: 'NoneType' object is not subscriptable
The API returned no data for the given symbol (e.g., delisted or invalid ticker).
fix
Check the symbol exists and is active. Wrap calls in try/except or validate with `ticker.summary_profile`
requests.exceptions.HTTPError: 404 Client Error: Not Found
Yahoo Finance API endpoint changed or ticker not found.
fix
Update yahooquery to latest version. If persists, the ticker may be delisted.
Upgrade
Version history
2.4.1latest on PyPI · released May 15, 2025
Audit
Dependencies
requestsrequiredHTTP requests to Yahoo Finance API
pandasoptionalData manipulation and output formatting
Agent activity
43 hits · last 30 days
node
38
OpenAI (training)
1
Resources
yahooquery — pip install yahooquery · libregistry