import json


def get_response_item(resource_property: str, key: str, channel_id: str, path: str, ext='.json'):
    """
    Get the value for the key in the resource_property dict for the provided
    channel_id and path.
    Args:
    - resource_property: a key in the response dict corresponding to the resource property ('part') to search
    - key: key to search for in the resource_property dict
    - channel_id: channel id
    - path: directory to search; must end with trailing /
    """
    with open(path+channel_id+ext) as response:
        data = json.load(response)

    item = data[resource_property][key]

    return item