# Performs a web search and returns unified results from SearXNG, TinyFish or Brave Search.

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/web/search:
    get:
      summary: >-
        Performs a web search and returns unified results from SearXNG, TinyFish
        or Brave Search.
      deprecated: false
      description: >-
        SearXNG is used as the primary search provider. If SearXNG is
        unavailable or returns

        no results, TinyFish Search is tried next (when configured), then Brave
        Search.

        Each search costs 1 credit.
                    
        Example Request:

        `GET /v1/web/search?q=hello+world&count=10&safesearch=strict`
                    
        Possible error codes:

        - 400 (validation_error): Missing or invalid query parameter.

        - 401 (unauthorized): The API key is missing or invalid.

        - 402 (payment_required): Insufficient credits.

        - 502 (upstream_error): All search providers failed.
      tags:
        - Search
        - Search
      parameters:
        - name: Q
          in: query
          description: The user's search query. Maximum 400 characters.
          required: true
          example: ''
          schema:
            maxLength: 400
            type: string
        - name: Country
          in: query
          description: The 2-character country code for search results. Defaults to "us".
          required: false
          example: ''
          schema:
            type: string
        - name: Language
          in: query
          description: >-
            The language code for search results (e.g. de, en, fr). Defaults to
            "en".
          required: false
          example: ''
          schema:
            type: string
        - name: Count
          in: query
          description: Number of results to return. Maximum is 20.
          required: false
          example: 0
          schema:
            maximum: 20
            minimum: 1
            type: integer
            format: int32
        - name: Offset
          in: query
          description: Zero-based offset for pagination. Maximum is 9.
          required: false
          example: 0
          schema:
            maximum: 9
            minimum: 0
            type: integer
            format: int32
        - name: Safesearch
          in: query
          description: 'Safe search filtering: off, moderate, or strict.'
          required: false
          example: ''
          schema:
            type: string
        - name: Freshness
          in: query
          description: >-
            Filters results by page age: pd, pw, pm, py, or a date range
            YYYY-MM-DDtoYYYY-MM-DD.
          required: false
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
          headers: {}
          x-apidog-name: ''
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
          headers: {}
          x-apidog-name: ''
        '401':
          description: Unauthorized
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ProblemDetails'
          headers: {}
          x-apidog-name: ''
        '402':
          description: Payment Required
          content:
            application/json:
              schema: *ref_0
          headers: {}
          x-apidog-name: ''
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema: *ref_0
          headers: {}
          x-apidog-name: ''
      security:
        - ApiKey: []
          x-apidog:
            schemeGroups:
              - id: Mc0cG4A4XLcGS0YA4VR99
                schemeIds:
                  - ApiKey
            required: true
            use:
              id: Mc0cG4A4XLcGS0YA4VR99
            scopes:
              Mc0cG4A4XLcGS0YA4VR99:
                ApiKey: []
      x-apidog-folder: Search
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1110200/apis/api-44734730-run
components:
  schemas:
    SearchResponse:
      required:
        - query
        - provider
        - results
      type: object
      properties:
        query:
          type: string
          description: The original search query.
          nullable: true
        provider:
          type: string
          description: Which provider delivered the results (searxng, tinyfish or brave).
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResultItem'
          description: The list of search results.
          nullable: true
        suggestions:
          type: array
          items:
            type: string
          description: Search suggestions, if available (primarily from SearXNG).
          nullable: true
        moreResultsAvailable:
          type: boolean
          description: >-
            Whether more results are available for pagination (primarily from
            Brave).
          nullable: true
      additionalProperties: false
      description: Unified search response returned by the search endpoint.
      x-apidog-orders:
        - query
        - provider
        - results
        - suggestions
        - moreResultsAvailable
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    SearchResultItem:
      required:
        - title
        - url
        - description
      type: object
      properties:
        title:
          type: string
          description: The title of the search result.
          nullable: true
        url:
          type: string
          description: The URL of the search result.
          nullable: true
        description:
          type: string
          description: The description or content snippet of the search result.
          nullable: true
        publishedDate:
          type: string
          description: The published date of the result, if available.
          nullable: true
        thumbnail:
          type: string
          description: The thumbnail URL for the result, if available.
          nullable: true
      additionalProperties: false
      description: A single search result item in the unified response format.
      x-apidog-orders:
        - title
        - url
        - description
        - publishedDate
        - thumbnail
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
          nullable: true
      additionalProperties:
        type: string
      x-apidog-orders:
        - type
        - title
        - status
        - detail
        - instance
        - errors
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties:
        type: string
      x-apidog-orders:
        - type
        - title
        - status
        - detail
        - instance
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKey:
      type: apikey
      description: >-
        API Key authentication for programmatic access. Enter your API key in
        the text input below.
      name: apiKey
      in: query
servers:
  - url: https://api.scrapingduck.com
    description: Prod Env
security:
  - ApiKey: []
    x-apidog:
      schemeGroups:
        - id: Mc0cG4A4XLcGS0YA4VR99
          schemeIds:
            - ApiKey
      required: true
      use:
        id: Mc0cG4A4XLcGS0YA4VR99
      scopes:
        Mc0cG4A4XLcGS0YA4VR99:
          ApiKey: []

```
