Search#
- class yfinance.Search(query, max_results=8, news_count=8, lists_count=8, include_cb=True, include_nav_links=False, include_research=False, include_cultural_assets=False, enable_fuzzy_query=False, recommended=8, session=None, proxy=None, timeout=30, raise_errors=True)#
Fetches and organizes search results from Yahoo Finance, including stock quotes and news articles.
- Parameters:
query – The search query (ticker symbol or company name).
max_results – Maximum number of stock quotes to return (default 8).
news_count – Number of news articles to include (default 8).
lists_count – Number of lists to include (default 8).
include_cb – Include the company breakdown (default True).
include_nav_links – Include the navigation links (default False).
include_research – Include the research reports (default False).
include_cultural_assets – Include the cultural assets (default False).
enable_fuzzy_query – Enable fuzzy search for typos (default False).
recommended – Recommended number of results to return (default 8).
session – Custom HTTP session for requests (default None).
proxy – Proxy settings for requests (default None).
timeout – Request timeout in seconds (default 30).
raise_errors – Raise exceptions on error (default True).
Attributes
- all
filtered down version of response.
- Type:
Get all the results from the search results
- lists
Get the lists from the search results.
- nav
Get the navigation links from the search results.
- news
Get the news from the search results.
- quotes
Get the quotes from the search results.
- research
Get the research reports from the search results.
- response
Get the raw response from the search results.
Methods
- __init__(query, max_results=8, news_count=8, lists_count=8, include_cb=True, include_nav_links=False, include_research=False, include_cultural_assets=False, enable_fuzzy_query=False, recommended=8, session=None, proxy=None, timeout=30, raise_errors=True)
Fetches and organizes search results from Yahoo Finance, including stock quotes and news articles.
- Parameters:
query – The search query (ticker symbol or company name).
max_results – Maximum number of stock quotes to return (default 8).
news_count – Number of news articles to include (default 8).
lists_count – Number of lists to include (default 8).
include_cb – Include the company breakdown (default True).
include_nav_links – Include the navigation links (default False).
include_research – Include the research reports (default False).
include_cultural_assets – Include the cultural assets (default False).
enable_fuzzy_query – Enable fuzzy search for typos (default False).
recommended – Recommended number of results to return (default 8).
session – Custom HTTP session for requests (default None).
proxy – Proxy settings for requests (default None).
timeout – Request timeout in seconds (default 30).
raise_errors – Raise exceptions on error (default True).
- search() Search
Search using the query parameters defined in the constructor.