Skip to main content

A simple Yahoo Finance news scraper

Project description

SimpleYNews

SimpleYNews is a Python package that offers a simple way to scrape financial news from Yahoo! Finance for given stock tickers.

*** IMPORTANT LEGAL DISCLAIMER ***


Yahoo!, Y!Finance, and Yahoo! finance are registered trademarks of Yahoo, Inc.

SimpleYNews is not affiliated, endorsed, or vetted by Yahoo, Inc. It's an open-source tool that uses Yahoo's publicly available APIs, and is intended for research and educational purposes.

You should refer to Yahoo!'s terms of use (here, here, and here) for details on your rights to use the actual data downloaded. Remember - the Yahoo! finance API is intended for personal use only.

Installation

Install SimpleYNews using pip:

pip install simpleynews

Quick Start

from simpleynews import SimpleYNews

# Get news for a single ticker
aapl = SimpleYNews.Ticker("AAPL")
apple_news = aapl.news

# Print the results
print("News for AAPL:")
for item in apple_news:
    print(f"Title: {item['title']}")
    print(f"Link: {item['link']}")
    print(f"Publisher: {item['publisher']}")
    print(f"Publish Time: {item['providerPublishTime']}")
    print("---")

# Get news for multiple tickers
tickers = ["GOOGL", "MSFT"]
for ticker in tickers:
    news = SimpleYNews.Ticker(ticker).news
    print(f"\nNews for {ticker}:")
    for item in news:
        print(f"Title: {item['title']}")
        print(f"Link: {item['link']}")
        print(f"Publisher: {item['publisher']}")
        print(f"Publish Time: {item['providerPublishTime']}")
        print("---")

Features

  • Scrape latest news for given stock tickers from Yahoo! Finance
  • Simple and intuitive API similar to yfinance
  • Caching of news data to reduce repeated requests
  • Logging for better debugging and monitoring

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

SimpleYNews is distributed under the Apache License 2.0. See the LICENSE file for details.

Disclaimer

SimpleYNews is not affiliated, endorsed, or vetted by Yahoo, Inc. It's an open-source tool that uses Yahoo's publicly available APIs, and is intended for research and educational purposes only. You should refer to Yahoo!'s terms of use for details on your rights to use the actual data downloaded.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpleynews-0.3.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simpleynews-0.3.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file simpleynews-0.3.0.tar.gz.

File metadata

  • Download URL: simpleynews-0.3.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for simpleynews-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2b3b8018ab09b28bde3d79ca766b18ddb6e75a70c2c74cdd06ea0d14ba8d8d69
MD5 ff122874d040c42d85082d2d0b50fdbe
BLAKE2b-256 b80f416a3814c34f45aa4734a8c7ab7ff0168b5116c4f7e24608991f81200246

See more details on using hashes here.

File details

Details for the file simpleynews-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: simpleynews-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for simpleynews-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efcfcb5b5787dd7f566da6bf88a5223154f837bf4d5c84357665a24d53c326f0
MD5 af1d2e0a3d6d72cb7246deafb79013af
BLAKE2b-256 5dad7c26a6ef7bcdca140616540a6961e9d7fc383143ce0df79ef44d4d65d7ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page