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

# Google AI Mode search

> Get AI-generated search results from Google AI Mode.



## OpenAPI

````yaml GET /v1/google/ai-mode/search
openapi: 3.1.0
info:
  title: ScrapeBadger Google Scraper
  description: >-
    Dedicated API for scraping Google products (SERP, Maps, News, Hotels,
    Trends, Jobs, Shopping, Patents, Scholar, Autocomplete, Images, Videos,
    Finance, AI Mode, Lens, Products).
  version: 1.0.0
servers:
  - url: https://scrapebadger.com
    description: Production
security:
  - apiKeyAuth: []
paths:
  /v1/google/ai-mode/search:
    get:
      tags:
        - Google AI Mode
      summary: Google AI Mode search
      description: |-
        Get AI-generated search results from Google AI Mode.

        **Currently returns HTTP 501.** As of 2026 Google has repurposed
        the historical ``udm=50`` parameter — it now opens the Visual Search
        history prompt, not a dedicated AI Mode surface. There is no
        standalone ``/search?udm=50`` URL that returns AI-only content
        anymore; AI Overview blocks are rendered inside regular SERPs
        instead, gated on query + user + geolocation signals.

        **Recommended workaround:** call
        ``/v1/google/search?q=<query>&ai_overview=true``. The main SERP
        endpoint already parses the ``ai_overview`` block when Google
        includes one in the response, and the ``ai_overview=true`` flag
        automatically chases the deferred ``page_token`` follow-up fetch
        when Google serves the overview lazily. That's the exact data this
        endpoint was originally meant to return.

        This route remains registered so the product catalog, docs, and
        SDKs don't break — it will be re-enabled if/when Google ships a
        stable dedicated AI Mode surface again.
      operationId: search_ai_mode_api_v1_ai_mode_search_get
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            description: Search query for AI-generated response
            title: Q
          description: Search query for AI-generated response
        - name: gl
          in: query
          required: false
          schema:
            type: string
            description: Country code
            default: us
            title: Gl
          description: Country code
        - name: hl
          in: query
          required: false
          schema:
            type: string
            description: Language code
            default: en
            title: Hl
          description: Language code
        - name: include_html
          in: query
          required: false
          schema:
            type: boolean
            default: true
            description: >-
              Include the raw answer_html body (can be 100s of KB). Set false
              for just text_blocks + markdown.
            title: Include Html
          description: >-
            Include the raw answer_html body (can be 100s of KB). Set false for
            just text_blocks + markdown.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AiModeResponse:
      properties:
        text_blocks:
          items:
            $ref: '#/components/schemas/AiTextBlock'
          type: array
          title: Text Blocks
        references:
          items:
            $ref: '#/components/schemas/AiReference'
          type: array
          title: References
        query:
          type: string
          title: Query
        language:
          type: string
          title: Language
          default: en
        country:
          type: string
          title: Country
          default: us
        markdown:
          anyOf:
            - type: string
            - type: 'null'
          title: Markdown
          description: Compact Markdown rendering of the whole answer.
        answer_html:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer Html
          description: >-
            Raw answer body HTML (script/style stripped). Omitted when
            include_html=false.
      type: object
      required:
        - query
      title: AiModeResponse
      description: Response for GET /api/v1/ai-mode/search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AiTextBlock:
      properties:
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        snippet:
          anyOf:
            - type: string
            - type: 'null'
          title: Snippet
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        level:
          anyOf:
            - type: integer
            - type: 'null'
          title: Level
        header:
          items:
            type: string
          type: array
          title: Header
          description: Header cells for a table block.
        rows:
          items:
            $ref: '#/components/schemas/AiTableRow'
          type: array
          title: Rows
          description: Body rows for a table block.
      type: object
      title: AiTextBlock
      description: >-
        A block of the AI answer: paragraph | heading | list | table. A table
        block carries header + rows.
    AiReference:
      properties:
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
        snippet:
          anyOf:
            - type: string
            - type: 'null'
          title: Snippet
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
      type: object
      title: AiReference
      description: A reference cited in the AI response.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AiTableRow:
      properties:
        cells:
          items:
            type: string
          type: array
          title: Cells
      type: object
      title: AiTableRow
      description: One row of a table text_block (ordered cell values).
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````