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

# Search the web

> Performs a web search and returns search results with titles, URLs, and descriptions



## OpenAPI

````yaml /openapi.json POST /api/web/search
openapi: 3.0.1
info:
  title: Hyperbrowser API
  version: 1.0.0
servers:
  - url: https://api.hyperbrowser.ai
    description: Production server
security: []
paths:
  /api/web/search:
    post:
      summary: Search the web
      description: >-
        Performs a web search and returns search results with titles, URLs, and
        descriptions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebSearchParams'
      responses:
        '200':
          description: Search completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSearchResponse'
        '400':
          description: Invalid search parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: javascript
          label: Search the web
          source: |-
            import { Hyperbrowser } from '@hyperbrowser/sdk';

            const client = new Hyperbrowser({ apiKey: 'your-api-key' });

            const response = await client.web.search({
              query: 'hyperbrowser api',
              filters: {
                site: 'hyperbrowser.ai'
              }
            });
        - lang: python
          label: Search the web
          source: |-
            from hyperbrowser import Hyperbrowser
            from hyperbrowser.models import WebSearchParams, WebSearchFilters

            client = Hyperbrowser(api_key='your-api-key')

            response = client.web.search(WebSearchParams(
              query='hyperbrowser api',
              filters=WebSearchFilters(
                site='hyperbrowser.ai'
              )
            ))
components:
  schemas:
    WebSearchParams:
      type: object
      properties:
        query:
          type: string
        page:
          type: integer
        maxAgeSeconds:
          type: integer
        location:
          $ref: '#/components/schemas/WebSearchLocation'
        filters:
          $ref: '#/components/schemas/WebSearchFilters'
      required:
        - query
    WebSearchResponse:
      type: object
      properties:
        jobId:
          type: string
        status:
          $ref: '#/components/schemas/WebSearchStatus'
        error:
          type: string
          nullable: true
        data:
          $ref: '#/components/schemas/WebSearchResponseData'
      required:
        - jobId
        - status
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
    WebSearchLocation:
      type: object
      properties:
        country:
          type: string
        state:
          type: string
        city:
          type: string
      required:
        - country
    WebSearchFilters:
      type: object
      properties:
        exactPhrase:
          type: boolean
        semanticPhrase:
          type: boolean
        excludeTerms:
          type: array
          items:
            type: string
        boostTerms:
          type: array
          items:
            type: string
        filetype:
          $ref: '#/components/schemas/WebSearchFiletype'
        site:
          type: string
        excludeSite:
          type: string
        intitle:
          type: string
        inurl:
          type: string
    WebSearchStatus:
      type: string
      enum:
        - completed
        - failed
        - pending
        - running
        - stopped
    WebSearchResponseData:
      type: object
      properties:
        query:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/WebSearchResultItem'
      required:
        - query
        - results
    WebSearchFiletype:
      type: string
      enum:
        - pdf
        - doc
        - docx
        - xls
        - xlsx
        - ppt
        - pptx
        - html
    WebSearchResultItem:
      type: object
      properties:
        title:
          type: string
        url:
          type: string
        description:
          type: string
      required:
        - title
        - url
        - description
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````