def _get_key_recursively(response, key, limit):
    """ Recursively search for a key in a response 
    Not really sure if that's the most elegant solution."""
    if response is None:
        raise TypeError(
            'Either provide a response or a URL for the next_page and previous_page methods'
            )
    stack = [response]
    iters_performed = 0
    while iters_performed < limit and len(stack) > 0:
        for dct in stack:
            key_found = dct.get(key)
            if key_found is not None:
                return key_found
        new_stack = []
        for dct in stack:
            for k, v in dct.items():
                if type(v) == dict:
                    new_stack.append(v)
        stack = new_stack
        iters_performed += 1
    return None
