Skip to content

New Official SDKs for TypeScript, Python and Go

SerpKite
Get API key
Docs menu / Custom Search (CSE-compatible)

Custom Search (CSE-compatible)

For apps moving off the Google Custom Search JSON API: same query params (key, cx, q, start, num…), same items[] and searchInformation shape.

GET https://api.serpkite.com/customsearch/v1 Credits: 1 per page Try in playground
View as Markdown

For apps moving off the Google Custom Search JSON API, which Google shuts down on January 1, 2027. Same query parameters, same items[] and searchInformation shape. Change the host and the key, keep your parser.

cx is accepted and ignored: results come from the whole web, not a programmable search engine. Use siteSearch or a site: operator to restrict to a domain. This endpoint keeps Google's own parameter names (gl, hl, lr…) and is not under /v1.

Query parameters

ParameterTypeDefaultDescription
q requiredstringThe search query. Required.
keystringYour SerpKite API key (or send Authorization: Bearer).
cxstringAccepted and ignored.
startinteger1Index of the first result, 1–91 (1, 11, 21…).
numinteger10Results per call, 1–10.
glstringCountry code (Google CSE name).
hlstringInterface language (Google CSE name).
lrstringLanguage restrict, e.g. lang_de.
safestringSafeSearch. One of: active, off.
dateRestrictstringRecency, e.g. d7, w2, m6, y1.
siteSearchstringRestrict to a site.
searchTypestringimage for image results. One of: image.

Example request

Pass your key as ?key= like Google's API, or send Authorization: Bearer $SERPKITE_API_KEY.

curl "https://api.serpkite.com/customsearch/v1?q=site%3Adocs.python.org+asyncio&cx=any" \
  -H "Authorization: Bearer $SERPKITE_API_KEY"

Response fields

FieldTypeDescription
kindstringcustomsearch#search.
searchInformationobjectsearchTime, formattedSearchTime, totalResults, formattedTotalResults.
items[]arraykind, title, htmlTitle, link, displayLink, snippet, htmlSnippet, formattedUrl, htmlFormattedUrl, pagemap, image.
queriesobjectrequest[] and nextPage[] as in the CSE API.

Example response

200 OK · illustrative
{
  "kind": "customsearch#search",
  "searchInformation": {
    "searchTime": 0.94,
    "formattedSearchTime": "0.94",
    "totalResults": "1240000",
    "formattedTotalResults": "1,240,000"
  },
  "items": [
    {
      "kind": "customsearch#result",
      "title": "asyncio — Asynchronous I/O",
      "htmlTitle": "<b>asyncio</b> — Asynchronous I/O",
      "link": "https://docs.python.org/3/library/asyncio.html",
      "displayLink": "docs.python.org",
      "snippet": "asyncio is a library to write concurrent code using the async/await syntax."
    }
  ],
  "queries": {
    "request": [
      {
        "searchTerms": "site:docs.python.org asyncio",
        "count": 10,
        "startIndex": 1
      }
    ]
  }
}

Errors

Errors use one shape: {"error":{"code","message","request_id"}}. Errors are never billed. Full list in Errors.

StatusCodeMeaning
400invalid_requestA parameter is missing or invalid.
401unauthorizedThe API key is missing, invalid or revoked.
402insufficient_creditsYour balance is too low. Buy a pack or wait for the monthly free grant.
429rate_limitedToo many requests per second for your plan. Retry after the Retry-After header.
503upstream_errorGoogle could not be fetched or parsed. Not billed; retry after Retry-After.

Notes

  • Errors use SerpKite's error shape ({"error":{"code","message","request_id"}}), not Google's.