100 free credits. No credit card required. Get a key

Google search API

Google’s web results for a query as JSON: organic results with real URLs, snippets, dates and sitelinks, the knowledge graph, answer box, top stories, people also ask and related searches, per country, language and location, with time filters.

GET /v1/google/searchBeta1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/google/search?q=coffee&gl=us&hl=en",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"searchParameters": {
"q": "coffee",
"type": "search",
"engine": "google",
"gl": "us",
"hl": "en",
"num": 10,
"page": 1
},
"knowledgeGraph": {
"title": "Coffee",
"type": "Beverages",
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTE6lrHyuQPiYit9aNvXK7nG6zzLMa6qFWhAjo2Ye7T8aW8zHT0QVfZKOneYCpMuZgT…"
},
"organic": [
{
"title": "Coffee",
"link": "https://en.wikipedia.org/wiki/Coffee",
"snippet": "Coffee is a beverage brewed from roasted, ground coffee beans. Dark-colored and bitter, coffee has a stimulating effect …",
"source": "Wikipedia",
"displayedLink": "https://en.wikipedia.org › wiki › Coffee",
"position": 1
},
{
"title": "Specialty Coffee | Buy Coffee Online",
"link": "https://www.drinktrade.com/collections/all?srsltid=AYCX9vIiydeZo_t93sXLy1r-rthRuzUwPVPD66jgXx7v0asDnTdDsIg2",
"snippet": "Choose from a wide variety of coffee from the top roasters in the US. All our specialty coffee is roasted to order and s…",
"source": "Trade Coffee",
"displayedLink": "https://www.drinktrade.com › collections › all",
"rating": 4.8,
"position": 2
},
"… 6 more"
],
"peopleAlsoAsk": [
{
"question": "Which organ is most affected by coffee?"
},
{
"question": "What is the 80/20 rule for coffee?"
},
"… 2 more"
],
"relatedSearches": [
{
"query": "Coffee nearby"
},
{
"query": "Coffee types"
},
"… 6 more"
]
}

Parameters

NameTypeDescription
qquery · requiredstringThe search, as typed into Google (operators work). Example: coffee.
glquerystringCountry to search from, default us. Example: gb.
hlquerystringInterface language, default en. Example: de.
locationquerystringWhere the search happens, as a canonical place name ("Austin,Texas,United States"). Example: Austin,Texas,United States.
numqueryintegerResults per page (default 10, at most 100).
pagequeryintegerPage, from 1.
tbsquerystringTime filter: qdr:h (past hour), qdr:d, qdr:w, qdr:m, qdr:y, or a cdr:1,cd_min:…,cd_max:… range. Example: qdr:w.
safequery"active" | "off"SafeSearch, default off. One of active, off.
Status codes
StatusMeaning
200The result page.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404No Google Maps place matches that reference.
429Too many requests. Wait for Retry-After seconds.
503Google is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Same fields as other SERP APIs?

Yes: searchParameters, organic, knowledgeGraph, answerBox, topStories, peopleAlsoAsk, relatedSearches.

More than 10 results?

num up to 100 reads that many results over several pages; page moves through them.

Fresh results?

tbs=qdr:h is the past hour; those are cached 10 minutes, other searches longer.

Google is a trademark of Google LLC. We are not affiliated with or endorsed by Google.