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.2.0.tar.gz (8.3 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.2.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simpleynews-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8c8bd74712fc323f36359d74abd4e4f1dbeb59ebb745787ebc02e807eb08fb94
MD5 fb25c29a91ee19336c4357e84e9b642e
BLAKE2b-256 7634d85780229381e28ddbede87c5add4d0ee874791dcc60d255d1267c96c5a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpleynews-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7bebf74c91b8ef3c9034186256f93928a51b0801e7a79e12b5a87105c4119d9
MD5 c6ac821d0b4353f3d0d010d5f0267a52
BLAKE2b-256 4ba80fea1ee4037044310845d610f7abbd8f0745236cd706899c9f4613a87345

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