import requests


def get_request(url, max_tries=10):
    """ Get JSON data from BiGG RESTful API.

    Args:
        url (str): url request
        max_tries (int): maximum number of communication attempts (default: 10)

    Returns:
        dict: json data

    """
    resp, data = None, None

    for i in range(max_tries):
        try:
            resp = requests.get(url)
        except:
            pass
        if resp is not None:
            data = resp.json()
            break

    if data is None:
        print('max number of attempts exceeded:', max_tries)
        print('try again? [y]/n')
        resp = input()
        if resp.lower() != 'n':
            data = get_request(url)

    return data