> ## 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.

# Autocomplete

> Native Brave search-box suggestions with optional entity descriptions and images.

Get suggestions for a partial query. `query` is nonblank, up to 2,048 characters;
`country` defaults to `us` and accepts the [native locale codes](https://docs.scrapebadger.com/api-reference/endpoint/brave/locales.md).

**Credits:** 2 per nonempty successful response. Confirmed empty suggestions and errors are unbilled.

`suggestions` includes `query`, `type`, `is_entity`, and optional `name`, `desc`,
`img`, `category`, and `logo` when Brave provides them. The response also includes
`result_count`, `source_url`, and observation time as `fetched_at`/`fetched_utc`.

Invalid or unsupported parameters return `422`; a restricted key needs the `brave` scope.


## OpenAPI

````yaml GET /v1/brave/autocomplete
openapi: 3.1.0
info:
  title: Brave Search API
  version: 1.0.0
servers:
  - url: https://scrapebadger.com
security:
  - ApiKeyAuth: []
tags:
  - name: Brave
paths:
  /v1/brave/autocomplete:
    get:
      tags:
        - Brave
      summary: Autocomplete
      description: >-
        Native search-box suggestions with entity descriptions and images. Two
        credits.
      operationId: brave_autocomplete
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 2048
            title: Query
        - name: country
          in: query
          required: false
          schema:
            enum:
              - us
              - all
              - ar
              - au
              - at
              - be
              - br
              - ca
              - cl
              - cn
              - dk
              - fi
              - fr
              - de
              - gr
              - hk
              - in
              - id
              - it
              - jp
              - kr
              - my
              - mx
              - nl
              - nz
              - 'no'
              - ph
              - pl
              - pt
              - ru
              - sa
              - sg
              - za
              - es
              - se
              - ch
              - tw
              - tr
              - gb
            type: string
            default: us
            title: Country
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BraveAutocompleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BraveAutocompleteResponse:
      properties:
        query:
          type: string
          title: Query
        country:
          type: string
          title: Country
        suggestions:
          items:
            $ref: '#/components/schemas/BraveSuggestion'
          type: array
          title: Suggestions
        result_count:
          type: integer
          title: Result Count
        source_url:
          type: string
          title: Source Url
        fetched_at:
          type: string
          title: Fetched At
        fetched_utc:
          type: number
          title: Fetched Utc
      type: object
      required:
        - query
        - country
        - suggestions
        - result_count
        - source_url
        - fetched_at
        - fetched_utc
      title: BraveAutocompleteResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BraveSuggestion:
      properties:
        query:
          type: string
          title: Query
        type:
          type: string
          title: Type
        is_entity:
          type: boolean
          title: Is Entity
          default: false
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        desc:
          anyOf:
            - type: string
            - type: 'null'
          title: Desc
        img:
          anyOf:
            - type: string
            - type: 'null'
          title: Img
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        logo:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Logo
      additionalProperties: true
      type: object
      required:
        - query
        - type
      title: BraveSuggestion
    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:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

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