import requests


def get_awards(agency, keyword, year):
    """
    Get awards by agency, keyword, and year variables

    Returns json() response object

    """
    try:
        base_url = f'https://www.sbir.gov/api/awards.json?keyword={keyword}&agency={agency}&year={year}'

        return requests.get(base_url).json()
    except: 
        return 'error'