Use cases / Google Search API
Grounding LLM answers in search results
Last updated September 28, 2026. Response excerpts are recorded from the live API.
Who
Who runs this, and what for
| Team | What they decide with it |
|---|---|
| AI product teams | What current, sourced context to give a model before it answers. |
| Agent builders | Which pages an agent should open next, from what ranks for its query. |
| Research tools | Which sources to show beside a generated answer so readers can check it. |
Pipeline
The calls, step by step
01Search the question
Send the user's question, or a query the model writes from it, with the country and language of the user. Google's order is a useful relevance signal to keep.
GET /v1/search?engine=google_search&q=albert+einstein&country=us&page=1 · query
{ "q": "albert einstein", "language": "en", "country": "us", "page": 1 }Recorded response. Live values differ. 02Keep the top results as sources
Each result has a title, URL, snippet, and a date when Google shows one. Number them in the prompt and ask the model to cite by number.
GET /v1/search?engine=google_search&q=albert+einstein&country=us&page=1 · results.0
{ "position": 1, "title": "Albert Einstein", "url": "https://en.wikipedia.org/wiki/Albert_Einstein", "source": "Wikipedia", "displayed_url": "https://en.wikipedia.org › wiki › Albert_Einstein", "date": null, "snippet": "Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist ...", "sitelinks": [] }Recorded response. Live values differ. 03Add the knowledge graph when there is one
For people, places, and organisations, knowledge_graph carries a short description with its source and key facts. It is often the most direct answer on the page.
GET /v1/search?engine=google_search&q=albert+einstein&country=us&page=1 · knowledge_graph
{ "title": "Albert Einstein", "type": "Theoretical physicist", "description": "Albert Einstein was a German-born theoretical physicist best known for developing the theory of relativity.", "description_source": { "title": "Wikipedia", "url": "https://en.wikipedia.org/wiki/Albert_Einstein" }, "facts": { "Born": "March 14, 1879, Ulm, Germany", "Height": "5′ 9″" } }Recorded response. Live values differ.
Code
A script to start from
grounding.py
# Ground a model's answer in current Google results: search, keep the top
# results with their snippets, and pass them as numbered sources.
import os, requests
API = "https://api.clair.im"
HEADERS = {"Authorization": f"Bearer {os.environ['CLAIR_API_KEY']}"}
def google(q, country="us", language="en"):
r = requests.get(f"{API}/v1/search", headers=HEADERS, timeout=60, params={
"engine": "google_search", "q": q, "country": country, "language": language})
r.raise_for_status()
return r.json()
def sources_for(question, k=6):
body = google(question)
lines = []
if body.get("knowledge_graph"):
kg = body["knowledge_graph"]
lines.append(f"[0] {kg['title']} ({kg['type']}): {kg['description']}")
for r in body["results"][:k]:
date = f" ({r['date']})" if r["date"] else ""
lines.append(f"[{r['position']}] {r['title']}{date}\n{r['url']}\n{r['snippet']}")
return "\n\n".join(lines)
question = "What changed in the EU AI Act this year?"
prompt = (
"Answer using only the sources below, and cite them by number. "
"Say so if they do not answer the question.\n\n"
f"Sources:\n{sources_for(question)}\n\nQuestion: {question}"
)
print(prompt) # send to the model of your choice
Set CLAIR_API_KEY to a key subscribed to the Google Search API. Each call is one request against that API's monthly quota.
Cost
What it costs per month
| Schedule | Requests | Plan | Per month | Per 1,000 |
|---|---|---|---|---|
| 1,000 questions a monthOne search per question. | 1,000 | Pay as you go | $5.30 | $5.30 |
| 10,000 questions, 30% need a second query10,000 first searches plus 3,000 follow-ups the model writes. | 13,000 | Pro | $49 | $3.77 |
| 50,000 questions a monthOne search per question. | 50,000 | Ultra | $149 | $2.98 |
Measured
Response times
| Google Search API | |
|---|---|
| Succeeded | 18 of 20 |
| Median response time | 6.2 s |
| 95th percentile | 25.2 s |
| Had knowledge graph | 28% |
| Had people also ask | 94% |
| Had related searches | 78% |
| Had local results | 11% |
| Had videos | 33% |
Limits
What to plan for
- Snippets are short. For questions that need the page's content, fetch the top URLs yourself and pass the text.
- A live search takes seconds, and more at the slow end. Show a progress state, or search while the model plans.
- Clair returns organic results without ads or Google's AI Overview. That is usually what you want as sources.
- Google's results reflect country and language. Pass the user's, or the answers will cite sources for the wrong market.
FAQ
Common questions
Why not let the model browse on its own?
You can, but searching yourself gives you control: you choose the market, how many sources, and what the model sees, and you log exactly what it was given.
How many results should I pass?
Five to eight is a common range. More adds tokens and weaker sources; fewer risks missing the one that answers.
Is Clair faster than other search APIs?
No. Clair fetches a live page per call and is slower than the fastest SERP APIs; the SerpApi comparison has measured times.
Run it on your own products
200 requests a month free on each API, no card. Enough to run the pipeline on a short list before choosing a plan.
Bloomberg News API
Associated Press API
Glassdoor API
Greenhouse Jobs API

Crunchbase API
Website Contacts API