import requests


def get_stock_data(stock_symbol, start_date, end_date):    
    """
    Make an REST API call to the tiingo API to get historic stock data
    
    Parameters
    ----------
    stock_symbol : str
        US stock market symbol
    
    start_date : str
        yyyy-mm-dd formated date that begins time series
        
    end_date : str
        yyyy-mm-dd formated date that ends the time series   
        
    returns
    -------
    response : request.response
        The response object to be parsed
    """
    TIINGO_API_KEY='c391b96b9ea2e55ce48335fc7ab86245f2a41ec2'
    base_url = f'https://api.tiingo.com/tiingo/daily/{stock_symbol}/prices?'    
    payload = {
        'token':TIINGO_API_KEY,
        'startDate':start_date,
        'endDate':end_date
    }
    response = requests.get(base_url, params=payload)
    return response