Core APIs
...
Google
Core Requests
Autocomplete
3min
google autocomplete parameters get get /search?search type=autocomplete the google autocomplete parameters are applicable when making a request with search type=autocomplete to retrieve autocomplete results for a given search term the keyword searched can be specified in the q parameter and the optional location parameter can be used to geo locate the autocomplete request (locations can be retrieved via the locations api https //docs trajectdata com/scaleserp/locations api/overview ) for example, to request autocomplete results for the keyword tree in the location united states , the request would be http https //api scaleserp com/search?api key=demo\&search type=autocomplete\&q=tree\&location=united+statescurl l get https //api scaleserp com/search \\ d api key="demo" \\ d search type="autocomplete" \\ d q="tree" \\ d location="united+states"const axios = require('axios'); // set up the request parameters const params = { api key "demo", search type "autocomplete", q "tree", location "united+states" } // make the http get request axios get('https //api scaleserp com"/search', { params }) then(response => { // print the json response console log(json stringify(response data, 0, 2)); }) catch(error => { // catch and print the error console log(error); })import requests import json \# set up the request parameters params = { 'api key' 'demo', 'search type' 'autocomplete', 'q' 'tree', 'location' 'united+states' } \# make the http get request api result = requests get('https //api scaleserp com/search', params) \# print the json response print(json dumps(api result json()))\<?php \# set up the request parameters $querystring = http build query(\[ 'api key' => 'demo', 'search type' => 'autocomplete', 'q' => 'tree', 'location' => 'united+states' ]); \# make the http get request $ch = curl init(sprintf('%s?%s', 'https //api scaleserp com/search', $querystring)); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); $api result = curl exec($ch); curl close($ch); \# print the json response echo $api result; ?> google autocomplete parameters the following parameters are available for all requests made when search type=autocomplete parameter required description search type required should be set to search type=autocomplete q required the keyword you want to use to perform the autocomplete search location optional determines the geographic location in which the query is executed you can enter any location as free text, but if you choose one of the scale serp built in locations https //docs trajectdata com/scaleserp/locations api/overview then the google domain , gl and hl parameters are automatically updated to the domain, country and language that match the built in location (note that this behaviour can be disabled via the location auto parameter) location auto optional if the location field is set to a scale serp built in location https //docs trajectdata com/scaleserp/locations api/overview from the locations api https //docs trajectdata com/scaleserp/locations api/overview , and location auto is set to true (default) then the google domain , gl and hl parameters are automatically updated to the domain, country and language that match the built in location valid values are true (default) to enable this behaviour or false to disable uule optional the google uule parameter use to pass through a custom uule parameter to google scale serp automatically generates the uule when you use the location parameter but we allow you to overwrite it directly by specifying a uule directly google domain optional the google domain to use to run the search query view the full list of supported google domain values here https //docs trajectdata com/scaleserp/search api/reference/google domains defaults to google com gl optional the gl parameter determines the google country to use for the query view the full list of supported gl values here https //docs trajectdata com/scaleserp/search api/reference/google countries defaults to us hl optional the hl parameter determines the google ui language to return results view the full list of supported hl values here https //docs trajectdata com/scaleserp/search api/reference/google languages defaults to en autocomplete search index optional optional parameter to determine on which index of the string provided in the q param the autocomplete operation is requested different autocomplete results are returned by google depending on the index within the search term the user currently has their cursor set to next steps google autocomplete results https //docs trajectdata com/scaleserp/search api/results/google/autocomplete