import requests


def get_histohour(fsym = 'BTC', tsym = 'USD', e = 'CCCAGG', limit = 1920, optional_params = {}):
    """Gets hourly pricing info for given exchange
    
    Args:
        Required:
            fsym (str): From symbol
            tsym (str): To symbol
            e (str): Name of exchange
        Optional:
            extraParams (str): Name of app
            sign (bool): if true, server will sign requests
            tryConvention (bool): if false, get values without conversion
            aggregate (int): 
            limit (int): default: 168, max: 2000 (new default: 1920 (80 days))
            toTs (timestamp):
    
        Valid exchanges (e): 
            Cryptsy, BTCChina, Bitstamp, BTER, OKCoin, Coinbase, Poloniex, Cexio, BTCE, BitTrex, Kraken, 
            Bitfinex, Yacuna, LocalBitcoins, Yunbi, itBit, HitBTC, btcXchange, BTC38, Coinfloor, Huobi, 
            CCCAGG, LakeBTC, ANXBTC, Bit2C, Coinsetter, CCEX, Coinse, MonetaGo, Gatecoin, Gemini, CCEDK, 
            Cryptopia, Exmo, Yobit, Korbit, BitBay, BTCMarkets, Coincheck, QuadrigaCX, BitSquare, 
            Vaultoro, MercadoBitcoin, Bitso, Unocoin, BTCXIndia, Paymium, TheRockTrading, bitFlyer, 
            Quoine, Luno, EtherDelta, bitFlyerFX, TuxExchange, CryptoX, Liqui, MtGox, BitMarket, LiveCoin, 
            Coinone, Tidex, Bleutrade, EthexIndia, Bithumb, CHBTC, ViaBTC, Jubi, Zaif, Novaexchange, 
            WavesDEX, Binance, Lykke, Remitano, Coinroom, Abucoins, BXinth, Gateio, HuobiPro, OKEX
    
    Returns:
        history (str) hourly price history from fsym to tsym
    """
    url = "https://min-api.cryptocompare.com/data/histohour"
    params = {'fsym':fsym, 'tsym':tsym, 'e': e, 'limit': limit}
    for k,v in optional_params.items():
        params[k] = v
        
    r = requests.get(url = url, params = params)
    return r.text