Skip to content
Search Lab
Bing · United States · English Change
Country
Language
Device
Time
SafeSearch
Page
Bing · Python
import os

import requests

response = requests.get(
    "https://www.searchapi.io/api/v1/search",
    headers={"Authorization": f"Bearer {os.environ['SEARCHAPI_API_KEY']}"},
    params={
        "engine": "bing",
        "country_code": "US",
        "language": "en",
        "q": "how does a heat pump work",
    },
)
print(response.json())

The key is read from SEARCHAPI_API_KEY and sent as a Bearer token.