> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapeunblocker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scrape a Google search SERP for organic + ad results

> Runs a Google web search for `keyword` and returns a normalized JSON structure with `topAds`, `bottomAds`, `organic` results, `totalResults`, `aiOverview` (Google's AI-written summary as `text` and `markdown`, the hostnames it cites as `sources`, and the cited pages as `references` with title, real URL, source, domain and snippet; `null` when the search has none), and the proxy country actually used. Set `pages_to_check` 1-10 to paginate. `wait_after_load` adds a delay after the SERP loads.



## OpenAPI

````yaml /api-reference/openapi.json post /serpApi
openapi: 3.1.0
info:
  title: ScrapeUnblocker API
  description: >-
    Public API for the ScrapeUnblocker proxy/anti-bot service. Authenticate
    every request with the `x-scrapeunblocker-key` header. Documented here:
    page-source extraction, Google SERP scraping, image fetch, and the dedicated
    plugin endpoints (search engines, marketplaces, reviews, travel, social and
    more). All other paths exist for internal operations and are intentionally
    hidden from this spec.
  version: 3.0.0
servers:
  - url: https://api.scrapeunblocker.com
    description: Production
security: []
paths:
  /serpApi:
    post:
      tags:
        - Scraping
      summary: Scrape a Google search SERP for organic + ad results
      description: >-
        Runs a Google web search for `keyword` and returns a normalized JSON
        structure with `topAds`, `bottomAds`, `organic` results, `totalResults`,
        `aiOverview` (Google's AI-written summary as `text` and `markdown`, the
        hostnames it cites as `sources`, and the cited pages as `references`
        with title, real URL, source, domain and snippet; `null` when the search
        has none), and the proxy country actually used. Set `pages_to_check`
        1-10 to paginate. `wait_after_load` adds a delay after the SERP loads.
      operationId: run_serp_serpApi_post
      parameters:
        - name: keyword
          in: query
          required: true
          schema:
            type: string
            description: The search query, as typed into Google.
            title: Keyword
          description: The search query, as typed into Google.
        - name: proxy_country
          in: query
          required: false
          schema:
            type: string
            description: >-
              Two-letter ISO country code (e.g. `de`, `us`) of the exit IP, so
              the site serves that country's prices, language and content. Omit
              it and the country is picked for you. An unsupported code answers
              400 with the list of available countries.
            title: Proxy Country
          description: >-
            Two-letter ISO country code (e.g. `de`, `us`) of the exit IP, so the
            site serves that country's prices, language and content. Omit it and
            the country is picked for you. An unsupported code answers 400 with
            the list of available countries.
        - name: pages_to_check
          in: query
          required: false
          schema:
            type: integer
            maximum: 10
            minimum: 1
            description: >-
              How many Google result pages to fetch and merge, 1-10. Each page
              rendered is billed as one request; `pagesFetched` in the response
              says how many were.
            default: 1
            title: Pages To Check
          description: >-
            How many Google result pages to fetch and merge, 1-10. Each page
            rendered is billed as one request; `pagesFetched` in the response
            says how many were.
        - name: wait_after_load
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: >-
              Extra seconds to wait before extraction, on top of our own wait.
              Rarely needed.
            default: 0
            title: Wait After Load
          description: >-
            Extra seconds to wait before extraction, on top of our own wait.
            Rarely needed.
        - name: captcha_pause
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Kept for compatibility; it has no effect. Leave it at 0.
            default: 0
            title: Captcha Pause
          description: Kept for compatibility; it has no effect. Leave it at 0.
      responses:
        '200':
          description: JSON with organic/ads/totals.
          content:
            application/json:
              schema: {}
        '403':
          description: >-
            Google CAPTCHA after retries with different proxies — try another
            `proxy_country`.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '504':
          description: SERP fetch timed out.
      security:
        - ScrapeUnblockerKey: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ScrapeUnblockerKey:
      type: apiKey
      in: header
      name: x-scrapeunblocker-key
      description: Your ScrapeUnblocker API key. Apply on every request.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.