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

# Get Autocomplete

> Retrieve autocomplete suggestions for a partial query across DumplingAI's search providers.

## Description

This endpoint provides Google autocomplete suggestions based on a query.

## Endpoint

```
POST https://app.dumplingai.com/api/v1/get-autocomplete
```

## Headers

* **Content-Type:** `application/json`
* **Authorization:** Bearer `<API_KEY>` (required)

## Request Body

```json theme={null}
{
  "query": "string", // Required. The base query for which autocomplete suggestions are needed.
  "location": "string", // Optional. Location for contextualizing autocomplete suggestions.
  "country": "string", // Optional. Country code to refine suggestions. e.g., "US", "AU".
  "language": "string" // Optional. Language code for the suggestions. e.g., "en".
}
```

## Responses

### Success (200)

Returns the autocomplete suggestions for the provided query.

```json theme={null}
{
  "searchParameters": {
    "q": "DumplingAI",
    "type": "autocomplete",
    "engine": "google"
  },
  "suggestions": [
    {
      "value": "dumpling air fryer"
    },
    {
      "value": "dumpling ai"
    },
    {
      "value": "dumpling airpod case"
    },
    {
      "value": "dumpling air purifier"
    },
    {
      "value": "dumpling air fryer time"
    },
    {
      "value": "dumpling airport west"
    },
    {
      "value": "dumpling airport"
    },
    {
      "value": "can you air fry dumpling"
    },
    {
      "value": "can you do dumplings in an air fryer"
    },
    {
      "value": "can i put dumplings in the air fryer"
    }
  ]
}
```

* **Content-Type:** application/json
* **X-RateLimit-Limit:** The rate limit for the user.
* **X-RateLimit-Remaining:** The remaining number of requests for the user.

### Bad Request (400)

Returned if the request is invalid.

```json theme={null}
{
  "error": "Error message describing the issue"
}
```

### Unauthorized (401)

Returned if the API key is invalid or missing.

```json theme={null}
{
  "error": "Invalid or missing Authorization header"
}
```

### Internal Server Error (500)

Returned if there's an error during the autocomplete process.

```json theme={null}
{
  "error": "Failed to perform autocomplete: [error message]"
}
```

## Example Request

```bash theme={null}
curl -X POST https://app.dumplingai.com/api/v1/get-autocomplete \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "query": "DumplingAI",
  "location": "Sydney",
  "country": "AU",
  "language": "en"
}'
```

## Notes

* The `location`, `country`, and `language` fields are optional and can be used to refine the suggestions based on geographic and linguistic context.
* You can find a list of supported locations at GET: `/api/v1/google-locations`
* Credit usage:
  * Each autocomplete request consumes 30 credits.

## Rate Limiting

Rate limit headers (`X-RateLimit-Limit` and `X-RateLimit-Remaining`) are included in the response to indicate the user's current rate limit status.


## OpenAPI

````yaml POST /api/v1/get-autocomplete
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/get-autocomplete:
    post:
      tags:
        - Search
      summary: Get autocomplete suggestions
      description: >-
        Retrieve autocomplete suggestions for a partial query across
        DumplingAI's search providers.
      operationId: getAutocomplete
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutocompleteRequest'
            examples:
              default:
                value:
                  query: dumpling
      responses:
        '200':
          description: Autocomplete suggestions returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutocompleteResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AutocompleteRequest:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          description: Search phrase to autocomplete.
        location:
          type: string
          description: Free-form location context used by the upstream provider.
        country:
          type: string
          description: 2-letter country code forwarded to the provider as `gl`.
        language:
          type: string
          description: Language code forwarded to the provider as `hl`.
        requestSource:
          $ref: '#/components/schemas/RequestSource'
      additionalProperties: false
    AutocompleteResponse:
      type: object
      properties:
        searchParameters:
          type: object
          properties:
            q:
              type: string
            gl:
              type: string
              nullable: true
            hl:
              type: string
              nullable: true
            type:
              type: string
              nullable: true
            location:
              type: string
              nullable: true
            engine:
              type: string
              nullable: true
          required:
            - q
          additionalProperties: true
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/AutocompleteSuggestion'
      required:
        - searchParameters
        - suggestions
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
    AutocompleteSuggestion:
      type: object
      properties:
        value:
          type: string
      required:
        - value
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````