https://github.com/rubenafo/yahoofetcher
A python class to extract current and historical data from famous Yahoo Finance API
https://github.com/rubenafo/yahoofetcher
finance python yahoo-finance
Last synced: 2 months ago
JSON representation
A python class to extract current and historical data from famous Yahoo Finance API
- Host: GitHub
- URL: https://github.com/rubenafo/yahoofetcher
- Owner: rubenafo
- License: apache-2.0
- Created: 2012-12-15T16:41:15.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2019-02-28T07:38:11.000Z (over 6 years ago)
- Last Synced: 2025-04-24T18:50:47.606Z (6 months ago)
- Topics: finance, python, yahoo-finance
- Language: Python
- Size: 28.3 KB
- Stars: 12
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
YahooFetcher
===============A simple Python class to retrieve stock data from famous Yahoo Finance API.
Last update fixes the new Yahoo Finance API workaround that had to be implemented after 17th May when Yahoo decided to change the whole structure.Features:
* eod quotes, dividends and splits information
* Index components (up to 30 underlying instruments)
* NASDAQ and NYSE exchange componentsDisclaimer:
this module provides access to a non-official Yahoo API. In fact they do not provide any type of support/documentation
of it and all existent information has been obtained through reverse engineering.
Use at your own risk and do not abuse Yahoo resources.Example
=======
Run sampleMSFT.py to fetch IBM quote price for last year:
```python
import YahooFetchery = YahooFetcher.YahooFetcher()
print (y.getHistAsJson ('IBM','20160101','20161231'))
```
The output will look like
```javascript
[{'c': 175.800003, 'v': 4094800, 'ticker': 'IBM', 'h': 177.070007, 'adjc': 175.800003, 'l': 174.580002, 'date': '2017-01-30', 'o': 176.979996},
...]
```It also provides a method to extract the underlying components of an index (up to 30 components):
```python
print YahooQuery().getComponents("DJI")['JNJ', 'CAT', 'MCD', 'V', 'MSFT', 'PG', 'PFE', 'UTX', 'MMM', 'AXP', 'JPM', 'VZ', 'INTC', 'BA', 'GE', 'HD', 'GS', 'DIS', 'IBM', 'AAPL', 'UNH', 'XOM', 'WMT', 'KO', 'TRV', 'DD', 'NKE', 'MRK', 'CSCO', 'CVX']
```