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

# Gemini

> Extract structured data from the Google Gemini web interface - rich citation metadata with snippets, highlights, favicons, and site names - as clean JSON.

<Info>
  **Richest citation metadata**

  Gemini citations include `highlights` - the exact excerpts Gemini pulled from each source to support its answer. No other scraper returns this level of citation detail.
</Info>

## Overview

Use this endpoint to track brand citations in Google's AI ecosystem, research which pages Google's AI trusts for any topic, and monitor how Gemini presents your brand or competitors. The `highlights` field shows exactly which sentences from each source Gemini used - useful for content optimisation.

## Unique features

* **Highlights**: The exact excerpts Gemini extracted from each source to support its answer
* **Source snippets**: Full text excerpt from each cited page
* **Favicon + website name**: Human-readable site identity for each citation
* **Markdown response**: Full response as markdown via `result_markdown`

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  # Streaming can take up to 300s - --max-time matches the server timeout
  curl --max-time 300 \
    -G "https://api.scrapellm.com/scrapers/gemini" \
    --data-urlencode "api_key=YOUR_API_KEY" \
    --data-urlencode "prompt=What brands do marketers recommend for email automation?" \
    --data-urlencode "country=US"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.scrapellm.com/scrapers/gemini",
      headers={"X-API-Key": "YOUR_API_KEY"},
      params={
          "prompt": "What brands do marketers recommend for email automation?",
          "country": "US",
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    prompt: "What brands do marketers recommend for email automation?",
    country: "US",
  });

  const response = await fetch(
    `https://api.scrapellm.com/scrapers/gemini?${params}`,
    { headers: { "X-API-Key": "YOUR_API_KEY" } }
  );
  const data = await response.json();
  ```
</CodeGroup>

## Response schema

Includes [common response fields](/guides/making-requests#common-response-fields) plus:

| Field                      | Type    | Description                                                         |
| -------------------------- | ------- | ------------------------------------------------------------------- |
| `result`                   | string  | Plain-text response from Gemini                                     |
| `result_markdown`          | string  | Markdown-formatted response                                         |
| `citations`                | array   | Cited sources with rich metadata                                    |
| `citations[].title`        | string  | Article title of the cited page                                     |
| `citations[].url`          | string  | URL of the cited source                                             |
| `citations[].snippet`      | string  | Text excerpt from the source page                                   |
| `citations[].highlights`   | array   | Exact excerpts Gemini pulled from this source to support its answer |
| `citations[].website_name` | string  | Human-readable site name (e.g. `"HubSpot Blog"`)                    |
| `citations[].favicon`      | string  | URL of the site's favicon                                           |
| `llm_model`                | string  | Gemini model used (e.g. `gemini-2.0-flash`)                         |
| `credits_used`             | integer | Credits consumed - always `3` for Gemini                            |
| `elapsed_ms`               | float   | End-to-end request duration in milliseconds                         |
| `cached`                   | boolean | `true` if served from cache                                         |

## Common questions

### What are `highlights` and how are they different from `snippet`?

`snippet` is a general text excerpt from the page. `highlights` are the specific sentences Gemini extracted and used to ground its answer - they show exactly which parts of the source Gemini considered relevant. Highlights are especially useful for content optimisation: if Gemini highlights your content, that's strong signal for AI citation potential.

### How does Gemini compare to Google AI Mode?

Both are Google products but distinct surfaces. Gemini is the standalone AI assistant; Google AI Mode is the AI answer panel within Google Search. They return different citation sets, different source mixes, and serve different user intents. Run both for complete Google AI coverage.


## OpenAPI

````yaml GET /scrapers/gemini
openapi: 3.1.0
info:
  title: ScrapeLLM — Gemini Scraper
  version: 1.0.0
  description: >
    Scrape the real Google Gemini web interface via ScrapeLLM's browser pool.
    Returns the

    full response — including rich citation metadata with source snippets,
    highlighted

    excerpts, and favicons — as structured JSON.


    **Base URL:** `https://api.scrapellm.com`


    **Credits:** 3 per request · 500 free credits · No credit card required


    Get your API key at [scrapellm.com/signup](https://scrapellm.com/signup).
  contact:
    email: hello@scrapellm.com
    url: https://scrapellm.com
  license:
    name: ScrapeLLM Terms of Service
    url: https://scrapellm.com/terms
servers:
  - url: https://api.scrapellm.com
    description: Production
security:
  - ApiKeyHeader: []
  - ApiKeyQuery: []
tags:
  - name: Gemini Scraper
    description: Submit prompts to Google Gemini and receive structured responses.
paths:
  /scrapers/gemini:
    get:
      tags:
        - Gemini Scraper
      summary: Send a Gemini Scraping Request
      description: >
        Send a prompt to Google Gemini via a pool of real browsers and get the
        full response

        as structured JSON. Blocks until Gemini responds or `timeout` is
        reached.


        Gemini returns richer citation metadata than any other AI platform —
        each cited source

        includes a `snippet`, a list of `highlights` (the exact passages Gemini
        pulled), and

        `website_name`. This makes it especially valuable for AI SEO research.


        **Country restrictions** — JP and TW are not supported.


        **Authentication** — pass your API key via the `X-API-Key` header or as
        `?api_key=`

        in the URL.
      operationId: scrapeGemini
      parameters:
        - name: prompt
          in: query
          required: true
          description: The prompt to send to Gemini. Maximum 4,000 characters.
          schema:
            type: string
            minLength: 1
            maxLength: 4000
          example: Explain quantum entanglement simply.
        - name: country
          in: query
          required: false
          description: >
            ISO 3166-1 alpha-2 country code. Routes the request through
            infrastructure in

            that region for localised responses. JP and TW are not supported.
            Defaults to `US`.
          schema:
            type: string
            minLength: 2
            maxLength: 2
            default: US
          example: US
        - name: bypass_cache
          in: query
          required: false
          description: Skip the response cache and always fetch a fresh result.
          schema:
            type: boolean
            default: false
        - name: timeout
          in: query
          required: false
          description: >-
            Maximum seconds to wait for Gemini to respond. Must be between 10
            and 600.
          schema:
            type: number
            format: float
            minimum: 10
            maximum: 600
            default: 300
      responses:
        '200':
          description: Scrape completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeminiScrapeResponse'
              example:
                scraper: gemini
                status: done
                job_id: job_abc123
                prompt: What brands do marketers recommend for email automation?
                country: US
                result: >-
                  Marketers commonly recommend Mailchimp, HubSpot, and
                  Klaviyo...
                result_markdown: >-
                  Marketers commonly recommend **Mailchimp**, **HubSpot**, and
                  **Klaviyo**...
                citations:
                  - title: Best Email Marketing Platforms 2025
                    url: https://example.com/email-marketing
                    snippet: >-
                      We tested 12 tools across deliverability, automation, and
                      pricing...
                    highlights:
                      - Klaviyo leads for e-commerce with advanced segmentation
                      - Mailchimp remains the most accessible entry point
                    website_name: Marketing Weekly
                    favicon: https://example.com/favicon.ico
                llm_model: gemini-2.0-flash
                credits_used: 3
                elapsed_ms: 6521.8
                cached: false
                markdown_url: https://scrapellm.com/md/job_abc123.md
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: >-
                  Missing API key. Pass your key in the X-API-Key header or as
                  ?api_key= in the URL.
        '429':
          description: Credit limit reached or rate limit exceeded — retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Scraper returned an unexpected error — safe to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Gemini execution failed on the upstream scraper — safe to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Scraper pool is still warming up — retry in a few seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Network timeout reaching the scraper machine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: >
            # Streaming can take up to 300s - --max-time matches the server
            timeout

            curl --max-time 300 \
              -G "https://api.scrapellm.com/scrapers/gemini" \
              --data-urlencode "api_key=YOUR_API_KEY" \
              --data-urlencode "prompt=What brands do marketers recommend for email automation?" \
              --data-urlencode "country=US"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://api.scrapellm.com/scrapers/gemini",
                params={
                    "api_key": "YOUR_API_KEY",
                    "prompt": "What brands do marketers recommend for email automation?",
                    "country": "US",
                }
            )
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const params = new URLSearchParams({
              api_key: "YOUR_API_KEY",
              prompt: "What brands do marketers recommend for email automation?",
              country: "US",
            });

            const response = await fetch(
              `https://api.scrapellm.com/scrapers/gemini?${params}`
            );
            const data = await response.json();
            console.log(data);
        - lang: TypeScript
          label: TypeScript
          source: |
            const params = new URLSearchParams({
              api_key: "YOUR_API_KEY",
              prompt: "What brands do marketers recommend for email automation?",
              country: "US",
            });

            const response = await fetch(
              `https://api.scrapellm.com/scrapers/gemini?${params}`
            );
            const data = await response.json();
            console.log(data);
components:
  schemas:
    GeminiScrapeResponse:
      type: object
      required:
        - scraper
        - status
        - job_id
        - prompt
        - country
        - result
        - credits_used
        - elapsed_ms
        - cached
      properties:
        scraper:
          type: string
          description: Always `"gemini"`.
          example: gemini
        status:
          type: string
          description: '`"done"` on success.'
          example: done
        job_id:
          type: string
          description: Unique identifier for this scrape job.
          example: job_abc123
        prompt:
          type: string
          description: The prompt that was submitted.
          example: What brands do marketers recommend for email automation?
        country:
          type: string
          description: The country the request was routed through.
          example: US
        result:
          type: string
          description: Plain-text response from Gemini.
          example: Marketers commonly recommend Mailchimp, HubSpot, and Klaviyo...
        result_markdown:
          type: string
          nullable: true
          description: >-
            Markdown-formatted response from Gemini with inline citation
            markers.
          example: >-
            Marketers commonly recommend **Mailchimp**, **HubSpot**, and
            **Klaviyo**...
        citations:
          type: array
          description: >
            Sources cited by Gemini. Gemini provides the richest citation
            metadata of any

            AI platform — each source includes a snippet, highlighted passages,
            and site name.
          items:
            $ref: '#/components/schemas/GeminiCitation'
        llm_model:
          type: string
          nullable: true
          description: Gemini model variant used (e.g. `gemini-2.0-flash`).
          example: gemini-2.0-flash
        credits_used:
          type: integer
          description: Credits consumed by this request. Always `3` for Gemini.
          example: 3
        elapsed_ms:
          type: number
          format: float
          description: Total end-to-end request duration in milliseconds.
          example: 6521.8
        cached:
          type: boolean
          description: '`true` if this response was served from cache.'
          example: false
        markdown_url:
          type: string
          nullable: true
          description: |
            Hosted `.md` URL for this response. Expires after 24 hours.
          example: https://scrapellm.com/md/job_abc123.md
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable description of the error.
          example: Invalid API key.
    GeminiCitation:
      type: object
      required:
        - title
        - url
      properties:
        title:
          type: string
          description: Title of the cited page.
          example: Best Email Marketing Platforms 2025
        url:
          type: string
          format: uri
          description: Absolute URL of the cited source.
          example: https://example.com/email-marketing
        snippet:
          type: string
          nullable: true
          description: Excerpt from the cited page as shown by Gemini.
          example: We tested 12 tools across deliverability, automation, and pricing...
        highlights:
          type: array
          description: >
            Specific passages Gemini extracted from the source. These are the
            exact sentences

            that influenced Gemini's answer — a unique signal for AI SEO
            research.
          items:
            type: string
          example:
            - Klaviyo leads for e-commerce with advanced segmentation
            - Mailchimp remains the most accessible entry point
        website_name:
          type: string
          nullable: true
          description: Human-readable site name (e.g. `"Wikipedia"`, `"Marketing Weekly"`).
          example: Marketing Weekly
        favicon:
          type: string
          format: uri
          nullable: true
          description: Favicon URL for the cited domain.
          example: https://example.com/favicon.ico
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your ScrapeLLM API key passed in the request header.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Your ScrapeLLM API key passed as a query parameter.

````