Skip to content

HTTPError: 401 Client Error: PermissionDenied for url: https://api.bing.microsoft.com/v7.0/search #152

@ShirleyLYXX

Description

@ShirleyLYXX

I wrote:
import requests

headers = {"Ocp-Apim-Subscription-Key": subscription_key} # 'subscription_key' is my api key
params = {"q": search_term, "textDecorations": True, "textFormat": "HTML"}
response = requests.get(search_url, headers=headers, params=params, verify=False)
response.raise_for_status()
search_results = response.json()

but return:

HTTPError: 401 Client Error: PermissionDenied for url: https://api.bing.microsoft.com/v7.0/search?q=Microsoft+Bing+Search+Services&textDecorations=True&textFormat=HTML

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions