WillKoehrsen / Data-Analysis

Data Science Using Python

Home Page:https://medium.com/@williamkoehrsen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stocker using yahoo

iwalucas opened this issue · comments

Would it be possible to have yahoo as a source for the stocker? QUANDL doesnt offer (for free) all world stocks.

Tks

Here is the full code:

import pandas_datareader.data as web
import datetime

# Class for analyzing and (attempting) to predict future prices
# Contains a number of visualizations and analysis methods
class Stocker():
    
    # Initialization requires a ticker symbol
    def __init__(self, ticker, exchange='NS'):
        
        # Enforce capitalization
        ticker = ticker.upper()
        
        # Symbol is used for labeling plots
        self.symbol = ticker
        
        # Use Personal Api Key
        # quandl.ApiConfig.api_key = 'YourKeyHere'

        # Retrieval the financial data
        try:
            #stock = quandl.get('%s/%s' % (exchange, ticker))
            start = datetime.datetime(2000, 1, 1)
            end = datetime.datetime.now()
            stock = web.DataReader(ticker, 'yahoo', start, end)
        

Tks @cnubathula !

@iwalucas how do you get free data from yahoo? very interested
(sorry i know this is closed)

@kevb10 I think its free, it just works

what's the endpoint and stuff. i'm unable to find it