Account and Locations

Use account and locations helpers for account metadata and valid Google locations.

The client includes helpers for SerpApi account metadata and Google locations.

Account

Use account() to inspect information for the configured API key:

import os
import serpapi

client = serpapi.Client(api_key=os.environ["SERPAPI_KEY"])

account = client.account()
print(account)

This is useful in diagnostics, internal tooling, and setup checks.

Locations

Use locations() to find supported Google locations:

locations = client.locations(q="Austin", limit=5)

for location in locations:
    print(location.get("name"), location.get("canonical_name"))

Then pass the selected location to a search:

results = client.search(
    engine="google",
    q="coffee",
    location="Austin, Texas, United States",
)

The SerpApi Locations API documentation has the full endpoint behavior.