import requests


def get_closed_solicitations(agency):
    """
    Gets closed solicitations for a given agency abbreviation
    
    Returns json() response object
    
    """
    try:
        base_url = f'https://www.sbir.gov/api/solicitations.json?keyword=sbir&agency={agency}&closed=1'

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