SerpData
Get API key

API reference

13 endpoints on one host, authenticated with a header. Every successful request costs one credit, and failures cost nothing.

Authentication

Send your key in the x-api-key header. Keys are shown once when created, on the API keys page. Never ship a key in client-side code — anyone who can read it can spend your credits.

Making a request

Every endpoint takes GET with query string parameters or POST with a JSON body.

curl "https://api.serpdata.dev/google/search/web?q=best%20espresso%20machine" \
  -H "x-api-key: $SEARCHAPI_KEY"
curl -X POST "https://api.serpdata.dev/google/search/news" \
  -H "x-api-key: $SEARCHAPI_KEY" \
  -H "content-type: application/json" \
  -d '{"q":"openai"}'

City targeting

On /google/search/web, combine a canonical-name Google uule with the matching two-letter gl country code. Both search modes support location: mode=simple uses Google's Web results (udm=14), while mode=rich uses the full results page (no udm).

These examples target London, England, United Kingdom. For GET, use URL encoding so the plus sign survives transport. For a POST JSON body, paste the original w+…value. Do not paste an already percent-encoded value into JSON or the playground.

curl --get "https://api.serpdata.dev/google/search/web" \
  -H "x-api-key: $SEARCHAPI_KEY" \
  --data-urlencode "q=coffee shops near me" \
  --data-urlencode "mode=simple" \
  --data-urlencode "gl=gb" \
  --data-urlencode "uule=w+CAIQICIdTG9uZG9uLEVuZ2xhbmQsVW5pdGVkIEtpbmdkb20="
curl -X POST "https://api.serpdata.dev/google/search/web" \
  -H "x-api-key: $SEARCHAPI_KEY" \
  -H "content-type: application/json" \
  -d '{"q":"coffee shops near me","mode":"rich","gl":"gb","uule":"w+CAIQICIdTG9uZG9uLEVuZ2xhbmQsVW5pdGVkIEtpbmdkb20="}'

Supply a valid UULE encoded from a canonical name in Google's geographic-target dataset. Raw city names and coordinate-form a+ values are not accepted. Validation checks the value's syntax; it does not verify that the encoded city exists or matches your country. Successful responses echo gl and uule in searchParameters.

Location biases results toward the requested city; it does not exclude every result from elsewhere. In the playground, search for a city, region, or postal code in Location. Selecting a result sets UULE and its matching Country automatically. You can also paste a raw value into Location (UULE) under Advanced. Clear the location for a country-only search. The picker uses English names from Google’s location catalog. Suggestions are sorted by available population estimates from GeoNames, largest first. Locations without a matched population appear last.

Response

{  "searchParameters": {    "q": "python asyncio",    "type": "search",    "engine": "google"  },  "organic": [    {      "title": "Python's asyncio: A Hands-On Walkthrough",      "link": "https://realpython.com/async-io-python/",      "snippet": "Python's asyncio library enables you to write concurrent code using the async and await keywords. The core building bloc…",      "subtitle": "https://realpython.com › async-io-python",      "position": 3,      "date": "Jul 30, 2025",      "source": "Real Python",      "sitelinks": [        {          "title": "Async I/O in Python With asyncio",          "href": "https://realpython.com/async-io-python/#async-io-in-python-with-asyncio",          "style": "chip"        }      ]    }  ],  "latencyMs": 255,  "credits": 1,  "creditsRemaining": 2499}

Results come back in Google's order. Every response carries your remaining balance as creditsRemaining; the search and vertical routes also carry the credits that call cost, which is always 1. Entities gain fields over time, so parse leniently and ignore what you do not recognize.

Endpoints

Base url https://api.serpdata.dev.

GET/google/search/web

Google web results. Add mode=rich for the full page.

NameTypeDescription
qstringrequiredThe search query. OR can appear at most once; a query with two or more is rejected.
modesimple | richoptionalsimple (default) returns organic results only. rich also returns People Also Ask, top stories, the local pack, shopping, images, videos and related searches. It does not return a knowledge panel.
glstringoptionalTwo-letter country code, such as gb. Required when uule is set; choose the country containing that location.
uulestringoptionalCanonical-name Google UULE starting with w+. Biases results toward a city in either mode. Requires matching gl; coordinate-form a+ values are not supported.
startstring | numberoptionalOffset into Google's results, a multiple of 10 up to 90. Each page holds ten results.
hlstringoptionalGoogle's interface language, such as en, de or pt-BR. It sets the page's labels and can change which results rank.
lrstringoptionalOnly return pages written in these languages, such as lang_de. Join up to ten with |, as in lang_de|lang_fr.
tbsstringoptionalDate filter. qdr:d is the past day: use h, d, w, m or y for hour, day, week, month or year, with an optional count, as in qdr:m6. For a custom range, send cdr:1,cd_min:1/31/2026,cd_max:3/1/2026 (month/day/year); either end may be left out.
filter0 | 1optional0 also returns the similar results Google normally hides. 1, the default, hides them.
crstringoptionalOnly return pages from these countries, such as countryDE. Join up to ten with |, as in countryDE|countryAT. Unlike gl, which localizes results, this excludes pages from other countries.
safeactive | offoptionalactive turns on SafeSearch, which hides explicit results. off turns it off.
nfpr0 | 1optional1 searches for the query exactly as typed, instead of Google's spelling correction.

POST/google/search/videos

Google Videos results.

NameTypeDescription
qstringrequiredThe search query. OR can appear at most once; a query with two or more is rejected.

POST/google/search/images

Google Images results.

NameTypeDescription
qstringrequiredThe search query. OR can appear at most once; a query with two or more is rejected.

POST/google/search/news

Google News results.

NameTypeDescription
qstringrequiredThe search query. OR can appear at most once; a query with two or more is rejected.

POST/google/search/shopping

Google Shopping results.

NameTypeDescription
qstringrequiredThe search query. OR can appear at most once; a query with two or more is rejected.

GET/google/maps/place

One business by its Google CID, place ID or feature ID: address, rating, hours, phone, category.

NameTypeDescription
cidstringoptionalGoogle customer id, returned on every /places and /map result. Send one of cid, placeId or fid.
placeIdstringoptionalGoogle place ID, such as ChIJwc3zxvNdeUgR7U9zwP-ov3A, the kind the Google Places API returns. Use instead of cid.
fidstringoptionalGoogle feature ID, such as 0x48795df3c6f3cdc1:0x70bfa8ffc0734fed, returned as fid on every /map result. Use instead of cid.

GET/google/maps/place/reviews

Reviews for one business, page by page.

NameTypeDescription
cidstringoptionalGoogle customer id, returned on every /places and /map result. Send one of cid, placeId or fid.
placeIdstringoptionalGoogle place ID, such as ChIJwc3zxvNdeUgR7U9zwP-ov3A, the kind the Google Places API returns. Use instead of cid.
fidstringoptionalGoogle feature ID, such as 0x48795df3c6f3cdc1:0x70bfa8ffc0734fed, returned as fid on every /map result. Use instead of cid.
pageTokenstringoptionalThe nextPageToken from a previous response.
sortrelevant | newest | highest | lowestoptionalReview order: relevant (default, Google's own order), newest first, highest rating first, or lowest rating first. Keep the same sort when passing a pageToken.
hlstringoptionalTwo-letter language code, such as de. Reviews in other languages come back with textTranslated in this language. Defaults to en.

GET/google/maps/place/photos

Photos for one business.

NameTypeDescription
cidstringoptionalGoogle customer id, returned on every /places and /map result. Send one of cid, placeId or fid.
placeIdstringoptionalGoogle place ID, such as ChIJwc3zxvNdeUgR7U9zwP-ov3A, the kind the Google Places API returns. Use instead of cid.
fidstringoptionalGoogle feature ID, such as 0x48795df3c6f3cdc1:0x70bfa8ffc0734fed, returned as fid on every /map result. Use instead of cid.

GET/google/maps/area/places

Businesses inside a map viewport.

NameTypeDescription
querystringrequiredThe search query.
latnumberrequiredLatitude of the viewport's center.
lngnumberrequiredLongitude of the viewport's center.
zoomnumberoptionalGoogle Maps zoom level.
offsetnumberoptionalResults to skip.
limitnumberoptionalResults to return.

POST/google/maps/search/places

Local business results for a query.

NameTypeDescription
qstringrequiredThe search query.
latnumberoptionalLatitude of the viewport's center. Omit lat and lng to search nationally.
lngnumberoptionalLongitude of the viewport's center.
limitnumberoptionalResults to return, 1 to 200. Defaults to 20.

POST/google/trends

Google Trends keyword comparisons, geographic breakdowns, related searches and Trending Now.

NameTypeDescription
mode"keyword" | "trending"optionalKeyword analysis (default) or Trending Now country feed.
resolutionsCOUNTRY | REGION | CITY | DMA[]optionalGeographic breakdowns to fetch; empty uses Google’s default. DMA means US metro areas. Each resolution adds a Google request.
keywordsstring[]optionalRequired in keyword mode; compare one to five keywords or topic IDs.
geostringoptional
timestringoptional
categorynumberoptional
property | images | news | youtube | froogleoptional
languagestringoptional
timezonenumberoptional
sectionsinterestOverTime | interestByRegion | relatedQueries | relatedTopics[]optional
hours4 | 24 | 48 | 168optional
categories1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20[]optionalTrending Now category IDs (different from Explore categories). Match any selected category; empty selects all.
limitnumberoptional

POST/google/autocomplete

The suggestions Google offers as a query is typed.

NameTypeDescription
qstringrequiredThe partial query.
glstringoptionalTwo-letter country code, such as gb.
hlstringoptionalTwo-letter language code, such as en.

POST/google/search/patents

Google Patents results.

NameTypeDescription
qstringrequiredThe search query.
pagenumberoptional1-based page number.

Rate limits

API keys have no requests-per-second limit. Each request requires an active key and sufficient credits. Service capacity still applies: an overloaded service can return 503, and failed requests do not consume credits.

Errors

StatusMeaning
400 BAD_REQUESTA parameter is missing or the wrong shape. Not charged.
401 UNAUTHORIZEDThe key is missing, unknown, or revoked. Not charged.
402 INSUFFICIENT_CREDITSYour balance is lower than the request costs. Top up on the billing page.
404 NOT_FOUNDNo such endpoint, or no place with that cid. The credit is returned.
500 INTERNAL_SERVER_ERRORSomething failed on our side. The credit is returned.
502 UPSTREAM_ERRORThe source site refused the request. The credit is returned.
503 SERVICE_UNAVAILABLECapacity is temporarily exhausted. The credit is returned. Honor Retry-After.
504 GATEWAY_TIMEOUTThe request outlived its deadline. The credit is returned and it can be retried.

A 200 costs one credit, including one that finds nothing — an empty result is an answer we had to go and get. Every failure above either never took the credit or gives it back, so retrying a failure cannot drain a balance.

Client library

npm install @serpdata.dev/client gives you a typed client for every endpoint above. It is server-side only, for the same reason keys are: it carries your key.

OpenAPI

/openapi.json is generated from the same contract the API implements, so it cannot drift from what the endpoints above actually return. Import it into Postman or generate a client in your own language.

Search supports country targeting with gl and city targeting with uule. Autocomplete supports country (gl) and language (hl). See each endpoint's parameters above for supported options.