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"
}
'import requests
url = "https://app.dumplingai.com/api/v1/get-autocomplete"
payload = { "query": "dumpling" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'dumpling'})
};
fetch('https://app.dumplingai.com/api/v1/get-autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dumplingai.com/api/v1/get-autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'dumpling'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dumplingai.com/api/v1/get-autocomplete"
payload := strings.NewReader("{\n \"query\": \"dumpling\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dumplingai.com/api/v1/get-autocomplete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"dumpling\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/get-autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"dumpling\"\n}"
response = http.request(request)
puts response.read_body{
"searchParameters": {
"q": "<string>",
"gl": "<string>",
"hl": "<string>",
"type": "<string>",
"location": "<string>",
"engine": "<string>"
},
"suggestions": [
{
"value": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Data APIs
Get Autocomplete
Retrieve autocomplete suggestions for a partial query across DumplingAI’s search providers.
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"
}
'import requests
url = "https://app.dumplingai.com/api/v1/get-autocomplete"
payload = { "query": "dumpling" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'dumpling'})
};
fetch('https://app.dumplingai.com/api/v1/get-autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dumplingai.com/api/v1/get-autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'dumpling'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dumplingai.com/api/v1/get-autocomplete"
payload := strings.NewReader("{\n \"query\": \"dumpling\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dumplingai.com/api/v1/get-autocomplete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"dumpling\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/get-autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"dumpling\"\n}"
response = http.request(request)
puts response.read_body{
"searchParameters": {
"q": "<string>",
"gl": "<string>",
"hl": "<string>",
"type": "<string>",
"location": "<string>",
"engine": "<string>"
},
"suggestions": [
{
"value": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<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, andlanguagefields 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.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Search phrase to autocomplete.
Free-form location context used by the upstream provider.
2-letter country code forwarded to the provider as gl.
Language code forwarded to the provider as hl.
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