Skip to main content
POST
/
api
/
v1
/
get-autocomplete
Get autocomplete suggestions
curl --request POST \
  --url https://app.dumplingai.com/api/v1/get-autocomplete \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "dumpling"
}'
{
  "searchParameters": {
    "q": "<string>",
    "gl": "<string>",
    "hl": "<string>",
    "type": "<string>",
    "location": "<string>",
    "engine": "<string>"
  },
  "suggestions": [
    {
      "value": "<string>"
    }
  ]
}

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

{
  "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.
{
  "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.
{
  "error": "Error message describing the issue"
}

Unauthorized (401)

Returned if the API key is invalid or missing.
{
  "error": "Invalid or missing Authorization header"
}

Internal Server Error (500)

Returned if there’s an error during the autocomplete process.
{
  "error": "Failed to perform autocomplete: [error message]"
}

Example Request

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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
string
required

Search phrase to autocomplete.

location
string

Free-form location context used by the upstream provider.

country
string

2-letter country code forwarded to the provider as gl.

language
string

Language code forwarded to the provider as hl.

requestSource
enum<string>

Optional identifier describing where the API request originated.

Available options:
API,
WEB,
MAKE_DOT_COM,
ZAPIER,
N8N,
PLAYGROUND,
DEFAULT_AUTOMATION,
AGENT_PREVIEW,
AGENT_LIVE,
AUTOPILOT,
STUDIO

Response

Autocomplete suggestions returned.

searchParameters
object
required
suggestions
object[]
required
I