Google AI Overview
Get Google's AI Overview for a query, with cited sources.
GET/api/v1/google/ai-overview
Costs 1 credit per request; failed requests are refunded. Authentication, the search_metadata envelope and error codes are the same as for every endpoint (see the API reference). Try it in the playground.
Parameters
Query and entity selectors
| Parameter | Type | Description |
|---|---|---|
qconditional | string | Google Search query, up to 4,000 characters.Up to 4,000 characters.Required unless ludocid or kgmid is supplied. |
ludocidconditional | string | Google local CID used to search for one entity.Up to 128 characters. |
kgmidconditional | string | Google Knowledge Graph machine ID, such as /m/0k8z.Up to 512 characters. |
Geographic location
| Parameter | Type | Description |
|---|---|---|
location | string | Human-readable city-level location encoded to UULE by serpfast.Up to 512 characters.Conflicts with uule and lat/lon. |
uule | string | Pre-encoded Google location value.Up to 2,048 characters.Conflicts with location and lat/lon. |
lat | number | Latitude from -90 through 90.Range: -90 to 90.Requires lon and conflicts with location and uule. |
lon | number | Longitude from -180 through 180.Range: -180 to 180.Requires lat and conflicts with location and uule. |
radius | number | Decimal search-bias radius in meters.Range: 1 to 1000.Requires location or lat/lon.Desktop: 1–199; tablet/mobile: 1–1,000. |
Knowledge Graph and layout controls
| Parameter | Type | Description |
|---|---|---|
lsig | string | Opaque Knowledge Graph or local-pack signature.Up to 4,096 characters. |
si | string | Opaque cached Google search context.Up to 4,096 characters. |
ibp | string | Google layout or expansion control.Up to 4,096 characters. |
uds | string | Opaque Google filter token.Up to 4,096 characters. |
color_scheme | "light" | "dark" | Google result color presentation. |
Localization, filtering, and pagination
| Parameter | Type | Description |
|---|---|---|
google_domain | string | Results use google.com. Use gl, hl, cr, lr or geography for localization.Default: google.com. |
gl | string | Lowercase two-letter country localization code. |
hl | string | Google interface and result language code.Default: en. |
cr | string | One or more countryXX restrictions joined with |. |
lr | string | One or more lang_xx restrictions joined with |. |
tbs | string | Google native date or search filter string.Up to 4,096 characters. |
safe | "active" | "off" | Google adult-content filtering. |
nfpr | "0" | "1" | Google auto-correction control. |
filter | "0" | "1" | Google similar-result filtering control. |
pws | "0" | "1" | Google personalization control; 0 asks for non-personalized results. |
peek_pws | "0" | "1" | Google personalization peek flag, forwarded unchanged. |
tbm | "lcl" | "vid" | "nws" | "shop" | "pts" | Google vertical: lcl, vid, nws, shop, or pts. For image searches, use /api/google/images. |
start | integer | Non-negative Google result offset.Default: 0.Minimum: 0. |
device | "desktop" | "tablet" | "mobile" | Request device profile and radius bound.Default: desktop. |
Advanced query parameters
| Parameter | Type | Description |
|---|---|---|
num | integer | Best-effort first-page result count, 1 to 10.Range: 1 to 10. |
as_dt | "i" | "e" | Includes or excludes as_sitesearch.Requires as_sitesearch. |
as_epq | string | Exact phrase query.Up to 2,048 characters. |
as_eq | string | Excluded phrase query.Up to 2,048 characters. |
as_lq | string | Require results that link to this URL.Up to 4,096 characters. |
as_nlo | integer | Inclusive range lower bound.Minimum: 0.Requires as_nhi. |
as_nhi | integer | Inclusive range upper bound.Minimum: 0.Requires as_nlo. |
as_oq | string | Any-of search terms.Up to 2,048 characters. |
as_q | string | Additional all-of search terms.Up to 2,048 characters. |
as_qdr | string | Quick range d, w, m, or y with an optional positive count. |
as_rq | string | Find pages related to this URL.Up to 4,096 characters. |
as_sitesearch | string | Site hostname to include or exclude.Up to 253 characters. |
Request context
Optional Google request context tokens. Omit them for a normal search.
| Parameter | Type | Description |
|---|---|---|
oq | string | Original query associated with an autocomplete selection.Up to 2,048 characters. |
gs_lp | string | Google gs_lp value associated with an autocomplete selection.Up to 4,096 characters. |
sclient | string | Google client identifier such as gws-wiz-serp.Up to 64 characters. |
Response
A JSON object with search_metadata (request id, credits used and remaining) and the result groups the page returns. Groups and fields depend on the content of each page, so treat every field as optional.
Examples
cURL
curl "https://serpfast.com/api/v1/google/ai-overview?q=why+is+the+sky+blue" \
-H "Authorization: Bearer $SERPFAST_KEY"Node.js 18+
const params = new URLSearchParams({
"q": "why is the sky blue"
});
const res = await fetch(`https://serpfast.com/api/v1/google/ai-overview?${params}`, {
headers: { Authorization: `Bearer ${process.env.SERPFAST_KEY}` },
});
const data = await res.json();
console.log(data);Python
import os, requests
params = {
"q": "why is the sky blue"
}
res = requests.get(
"https://serpfast.com/api/v1/google/ai-overview",
params=params,
headers={"Authorization": f"Bearer {os.environ['SERPFAST_KEY']}"},
timeout=120,
)
print(res.json())