Google local results API
Google Search’s local results: name, address, rating, review count, price level, category and a review quote, with the cid, place_id and data_id google_business_info takes.
GET /v1/google/search/placesBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/google/search/places?q=pizza&location=Austin,Texas,United%20States",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "searchParameters": { "q": "pizza", "type": "places", "engine": "google", "gl": "us", "hl": "en", "location": "Austin,Texas,United States", "num": 20, "page": 1 }, "places": [ { "position": 1, "title": "Roppolo’s Pizzeria", "address": "316 E 6th St", "rating": 4.2, "ratingCount": 1200, "priceLevel": "$10–20", "category": "Pizza", "cid": "14363647147486768618", "latitude": 30.26741, "longitude": -97.7397, "website": "https://roppolos.com/" }, { "position": 2, "title": "Pizza Di Roma", "address": "3316 Harmon Ave", "rating": 4.9, "ratingCount": 548, "priceLevel": "$10–20", "category": "Pizza", "cid": "13012201323136032844", "latitude": 30.291607, "longitude": -97.723366, "website": "http://pizzadiromaatx.com/" }, "… 8 more" ]}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | The search, as typed into Google (operators work). Example: coffee. |
glquery | string | Country to search from, default us. Example: gb. |
hlquery | string | Interface language, default en. Example: de. |
locationquery | string | Where the search happens, as a canonical place name ("Austin,Texas,United States"). Example: Austin,Texas,United States. |
numquery | integer | Results per page (default 20, at most 20). |
pagequery | integer | Page, from 1. |
safequery | "active" | "off" | SafeSearch, default off. One of active, off. |
Status codes
| Status | Meaning |
|---|---|
200 | The places. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No Google Maps place matches that reference. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Google is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
More detail on a place?
Pass its cid or place_id to google_business_info.
Google is a trademark of Google LLC. We are not affiliated with or endorsed by Google.