Suggestions
The
google_suggest
source is designed to retrieve Google search term suggestions.Parameter | Description | Default Value |
---|---|---|
source | google_suggest | |
query | UTF-encoded keyword | - |
locale | Accept-Language header value which changes your Google search page web interface language. More info. | - |
geo_location | The geographical location that the result should be adapted for. Using this parameter correctly is extremely important to get the right data. For more information, read about our suggested geo_location parameter structures here. | - |
user_agent_type | desktop | |
render | | |
callback_url | URL to your callback endpoint. | - |
- required parameter
API requests Google Suggestions page to retrieve suggestions for keyword
adidas
.JSON
cURL
Python
PHP
HTTP
{
"source": "google_suggest",
"query": "adidas"
}
curl --user "user:pass1" 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json" -d '{"source": "google_suggest", "query": "adidas"}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_suggest',
'query': 'adidas'
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
<?php
$params = [
'source' => 'google_suggest',
'query' => 'adidas'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1");
$headers = [];
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
https://realtime.oxylabs.io/v1/queries?source=google_suggest&query=adidas&access_token=12345abcde
The example above uses the Realtime integration method. If you would like to use some other integration method in your query (e.g. Push-Pull or Proxy Endpoint), refer to the integration methods section.
{
"results": [
{
"content": "[\"adidas\",[\"adidas\",\"adidas vietnam\",\"adidas us\",\"adidas uk\",\"adidas jp\",\"adidas superstar\",\"adidas stan smith\",\"adidas outlet\",\"adidas ultra boost\",\"adidas alphabounce\"],[],{\"google:suggestsubtypes\":[[512,433],[512,433],[512,433],[512],[3],[512],[512],[512],[512],[512]]}]",
"created_at": "2022-04-22 12:55:20",
"updated_at": "2022-04-22 12:55:24",
"page": 1,
"url": "https://www.google.com/complete/search?client=firefox&q=adidas&hl=en",
"job_id": "6923252904564388865",
"status_code": 200
}
]
}
Last modified 5mo ago