import requests


def iex_call(stock, dataType):
    """
    Generic executution of an API call to IEX Trading for the specified stock.
    :param stock: string of stock ticker -- all lowercase
    :param dataType: string to data type source (e.g. 'chart/5y')
    :return: JSON object
    """
    baseUrl = 'https://api.iextrading.com/1.0/stock/'
    return requests.get('{0}{1}/{2}'.format(baseUrl, stock, dataType)).text