import requests


def get_top_pairs(fsym='BTC', tsym='USD', limit=5, optional_params = {}):
    """ get the top [limit] pairs (from fsym to tsym)
    Args:
        Requried:
            fsym (str): From symbol 
            tsym (str): To symbol
        Optional:
            limit (int): number of pairs to return: default (5)
            sign (bool): if true, server will sign request
    
    Return:
        top pairs (str): get top pairs by volume for a currency (using aggregate data). 

    """
    url = "https://min-api.cryptocompare.com/data/top/pairs"
    params = {'fsym': fsym, 'tsym': tsym, 'limit': limit}
    for k,v in optional_params.items():
        params[k] = v
        
    r = requests.get(url=url, params=params)
    return r.text