HTTPError: 401 Client Error: PermissionDenied


Do you have any solution to the following issue
that may have started only because something at huggingface changed something

HTTPError: 401 Client Error: PermissionDenied for url:

How to rewrite this code to overcome the error?
The following is the codes the gives the error

type SEARCH_URL = ""

def get_image_urls_by_term(search_term: str, count=150):
    params  = {"q": search_term, "license": "public", "imageType": "photo", "count": count}
    response = requests.get(SEARCH_URL, params=params)
    response_data = response.json()
    image_urls = [img['thumbnailUrl'] for img in response_data['value']]
    return image_urlsor paste code here

Can we replace the above code with other license free and authentication free image sources