# Google Search

`POST https://api.serpkite.com/v1/search` · Credits: 1 per page (7 for `num=100`)

Organic results, knowledge graph, answer box, People Also Ask, related searches, top stories and sitelinks.

The main Google web search endpoint. One call returns the whole results page: organic results in `results` with resolved destination URLs, knowledge graph, answer box, People Also Ask, related searches, top stories and the local pack when Google shows them.

`related_searches` is always present (an empty array when Google shows none); the other extras appear only when the page has them.

## Request body

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `q` **required** | string |  | The search query. Required. Up to 2,048 characters. |
| `country` | string | `us` | Country to search from, as a two-letter ISO code (us, gb, de, in…). |
| `language` | string | `en` | Interface language, as a language code (en, de, fr, pt-BR…). |
| `location` | string |  | Canonical location for local results, e.g. "Austin, Texas, United States". Overrides country for geo. |
| `uule` | string |  | Google-encoded location string. Use instead of location if you already have it. |
| `num` | integer | `10` | Results per call. 10 per page; 100 fetches the top 100 as a depth bundle for 7 credits instead of 10. One of: `10`, `20`, `30`, `50`, `100`. |
| `page` | integer | `1` | Results page, 1–10. Each page is billed separately. |
| `time` | string |  | Restrict to recent results. Shorthand for tbs=qdr:*. One of: `hour`, `day`, `week`, `month`, `year`. |
| `tbs` | string |  | Raw Google tbs filter, e.g. qdr:w or cdr:1,cd_min:… |
| `device` | string | `desktop` | Which SERP layout to fetch. One of: `desktop`, `mobile`. |
| `safe` | string | `off` | SafeSearch filtering. One of: `off`, `active`. |
| `autocorrect` | boolean | `true` | Let Google correct misspelled queries. Set false to search the exact text. |
| `format` | string | `json` | Response format. markdown is LLM-ready prose; compact is JSON with only the fields agents need. One of: `json`, `compact`, `markdown`. |
| `fields` | string |  | Comma-separated projection, e.g. results.title,results.link,knowledge_graph. Cuts tokens. |
| `include_content` | integer | `0` | Also fetch the top N result pages (0–5) as Markdown. +1 credit per page. |
| `max_age` | integer |  | Accept a cached result up to this many seconds old. Cache hits cost 50% of the credits. |
| `ads` | boolean | `false` | Include sponsored results in ads. |
| `engine` | string or array | `google` | Which search providers may answer. google is Google only (SerpKite still fails over across its own proxy pools); auto falls back to other providers when Google is blocked or times out; consensus (search only) asks several independent indexes in parallel, merges the results by URL, ranks them by agreement and lists each result's sources, at the sum of one page per provider that returned results; a provider name or a list (e.g. google,brave) restricts the request to those. meta.engine names the provider that answered. One of: `google`, `auto`, `consensus`, `brave`, `bing`, `yahoo`, `duckduckgo`, `mojeek`, `wikipedia`. |

## Example request

cURL:

```bash
curl https://api.serpkite.com/v1/search \
  -H "Authorization: Bearer $SERPKITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q":"best espresso machine 2026","country":"us","language":"en"}'
```

TypeScript:

```ts
import { SerpKite } from "serpkite";

const sk = new SerpKite(); // reads SERPKITE_API_KEY
const res = await sk.search({ q: "best espresso machine 2026", country: "us", language: "en" });
console.log(res.results[0].title, res.meta.credits_used);
```

Python:

```python
from serpkite import SerpKite

sk = SerpKite()  # reads SERPKITE_API_KEY
res = sk.search("best espresso machine 2026", country="us", language="en")
print(res.results[0].title, res.meta.credits_used)
```

## Response fields

| Field | Type | Description |
| --- | --- | --- |
| `request` | object | The normalised request, with defaults filled in: `endpoint`, `engine`, `q`, `country`, `language`, `location`, `num`, `page`, `device`, `autocorrect`… |
| `results[]` | array | Organic results: `position`, `title`, `link` (resolved), `domain`, `displayed_link`, `snippet`, `date`, `sitelinks[]`, `attributes`, `rating`, `rating_count`, `content` (with `include_content`). |
| `answer_box` | object | `title`, `answer`, `snippet`, `snippet_highlighted[]`, `link`. |
| `knowledge_graph` | object | `title`, `type`, `website`, `image_url`, `description`, `description_source`, `description_link`, `attributes`. |
| `people_also_ask[]` | array | `question`, `snippet`, `title`, `link`. |
| `related_searches[]` | array | `query`. |
| `top_stories[]` | array | News items: `position`, `title`, `link`, `domain`, `source`, `date`, `image_url`. |
| `places[]` | array | Local pack, same shape as [/v1/maps](https://serpkite.com/docs/endpoints/maps) results. |
| `ads[]` | array | Sponsored results (only with `ads: true`). |
| `meta` | object | `request_id`, `credits_used`, `cached`, `cached_at`, `engine` (the provider that answered), `route` (provider attempts, see [Search providers](https://serpkite.com/docs/providers)), `latency_ms`, `parse_quality` (`ok`, `partial`, `empty`), `resolved_urls`. |

## Example response

```json
{
  "request": {
    "endpoint": "search",
    "engine": "google",
    "q": "best espresso machine 2026",
    "country": "us",
    "language": "en",
    "num": 10,
    "page": 1,
    "device": "desktop",
    "autocorrect": true
  },
  "results": [
    {
      "position": 1,
      "title": "The Best Espresso Machines of 2026, Tested and Reviewed",
      "link": "https://www.example.com/best-espresso-machines",
      "domain": "example.com",
      "displayed_link": "https://www.example.com › best-espresso-machines",
      "snippet": "We pulled more than 1,200 shots on 42 machines to find the best espresso makers for every budget, from beginner-friendly to prosumer.",
      "date": "Sep 12, 2026",
      "sitelinks": [
        {
          "title": "Best budget pick",
          "link": "https://www.example.com/best-espresso-machines#budget"
        },
        {
          "title": "Best dual boiler",
          "link": "https://www.example.com/best-espresso-machines#dual-boiler"
        }
      ]
    },
    {
      "position": 2,
      "title": "Espresso Machine Buying Guide (2026)",
      "link": "https://coffee.example.org/guides/espresso",
      "domain": "coffee.example.org",
      "displayed_link": "https://coffee.example.org › guides › espresso",
      "snippet": "Single boiler, heat exchanger or dual boiler? What the specs mean and which features are worth paying for."
    },
    {
      "position": 3,
      "title": "r/espresso: What machine would you buy in 2026?",
      "link": "https://www.reddit.com/r/espresso/comments/abc123/",
      "domain": "reddit.com",
      "displayed_link": "https://www.reddit.com › r › espresso",
      "snippet": "Discussion thread with 480 comments comparing entry-level and prosumer machines."
    }
  ],
  "people_also_ask": [
    {
      "question": "What is the #1 rated espresso machine?",
      "snippet": "Reviewers most often rank dual-boiler machines with PID control at the top…",
      "link": "https://www.example.com/best-espresso-machines"
    },
    {
      "question": "Is a $500 espresso machine worth it?",
      "snippet": "For daily drinkers, a mid-range machine usually pays for itself within a year…",
      "link": "https://coffee.example.org/guides/espresso"
    }
  ],
  "related_searches": [
    {
      "query": "best espresso machine under $500"
    },
    {
      "query": "best espresso machine for beginners"
    },
    {
      "query": "dual boiler vs heat exchanger"
    }
  ],
  "meta": {
    "request_id": "req_01J8ZK4M6Q2V7",
    "credits_used": 1,
    "cached": false,
    "engine": "google",
    "latency_ms": 942,
    "parse_quality": "ok",
    "resolved_urls": true
  }
}
```

## Errors

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `invalid_request` | A parameter is missing or invalid. |
| 401 | `unauthorized` | The API key is missing, invalid or revoked. |
| 402 | `insufficient_credits` | Your balance is too low. Buy a pack or wait for the monthly free grant. |
| 429 | `rate_limited` | Too many requests per second for your plan. Retry after the Retry-After header. |
| 503 | `upstream_error` | Google could not be fetched or parsed. Not billed; retry after Retry-After. |

All errors: https://serpkite.com/docs/errors

## Notes

- Set `format: "markdown"` or `"compact"` to cut tokens, or project fields with `fields` (e.g. `results.title,results.link,knowledge_graph`). See [Output formats](https://serpkite.com/docs/output-formats).
- `num: 100` returns the top 100 in one call for 7 credits. See [Pagination and depth](https://serpkite.com/docs/pagination-and-depth).
- `GET /v1/search?q=…` works too, with the same parameters in the query string.

## Related

- [Output formats](https://serpkite.com/docs/output-formats)
- [Page content](https://serpkite.com/docs/include-content)
- [Official SDKs](https://serpkite.com/docs/sdks)