Core APIs
...
Google
Core Requests
Search
4min
google search parameters get get /search the google search parameters are applicable when making a request to the search api to retrieve google search results for a given search term the search term is specified in the q parameter the location your search is run from is determined by the location parameter, which can be populated with a full name or gps coordinates value from the locations api https //docs trajectdata com/valueserp/locations api/overview for example, to request videos results for the keyword pizza in the location united states , the request would be http https //api valueserp com/search?api key=demo\&q=pizza\&location=united+statescurl l get https //api valueserp com/search \\ d api key="demo" \\ d q="pizza" \\ d location="united+states"const axios = require('axios'); // set up the request parameters const params = { api key "demo", q "pizza", location "united+states" } // make the http get request axios get('https //api valueserp 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', 'q' 'pizza', 'location' 'united+states' } \# make the http get request api result = requests get('https //api valueserp 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', 'q' => 'pizza', 'location' => 'united+states' ]); \# make the http get request $ch = curl init(sprintf('%s?%s', 'https //api valueserp 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 search parameters the following parameters are available for google search requests parameter required description q required the keyword you want to use to perform the search include ai overview optional only google com for desktop and mobile is supported to use this feature, add include ai overview=true to your request note if the search includes an ai overview, it will cost an additional credit if include ai overview=false , we will return a message to indicate whether or not ai overview is offered by google for your 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 value serp built in locations https //docs trajectdata com/valueserp/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) to get results based on latitude and longitude coordinates you should specify your location parameter in the form location=lat 43 437677,lon 3 8392765 where 43 437677 is your latitude value and 3 8392765 is your longitude value the gl and hl parameters are not automatically updated when using this format location auto optional if the location field is set to a value serp built in location https //docs trajectdata com/valueserp/locations api/overview from the locations api https //docs trajectdata com/valueserp/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 value 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/valueserp/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/valueserp/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/valueserp/search api/reference/google languages defaults to en lr optional the lr parameter limits the results to websites containing the specified language view the full list of supported lr values here https //docs trajectdata com/valueserp/search api/reference/google lr languages cr optional the cr parameter instructs google to limit the results to websites in the specified country view the full list of supported cr values here https //docs trajectdata com/valueserp/search api/reference/google cr countries time period optional determines the time period of the results shown it can be set to last hour , last day (for the last 24 hours), last week (for the last 7 days), last month , last year or custom when using custom you must also specifiy one or both of the time period min or time period max parameters to define the custom time period time period min optional determines the minimum (i e 'from') time to use when time period is set to custom should be in the form mm/dd/yyyy , i e for 31st december 2018 time period min would be 12/31/2018 time period max optional determines the maximum (i e 'to') time to use when time period is set to custom should be in the form mm/dd/yyyy , i e for 31st december 2018 time period max would be 12/31/2018 nfpr optional determines whether to exclude results from auto corrected queries that were spelt wrong can be set to 1 to exclude auto corrected results, or 0 (default) to include them filter optional determines if the filters for similar results and omitted results are on or off can be set to 1 (default) to enable these filters, or 0 to disable these filters safe optional determines whether safe search is enabled for the results can be set to active to enable safe search, or off to disable safe search page optional determines the page of results to return, defaults to 1 use in combination with the num parameter to implement pagination max page optional use the max page parameter to get multiple pages of results in one request the api will automatically paginate through pages and concatenate the results into one response see the pagination https //docs trajectdata com/valueserp/search api/pagination docs for more information num optional determines the number of results to show per page use in combination with the page parameter to implement pagination tbs optional sets a specific string to be added to the google tbs parameter in the underlying google query the tbs parameter is normally generated automatically by the api, but it can be set explicitly also knowledge graph id optional the knowledge graph id request parameter sets the kgmid google parameter you can use this to prompt a specific knowledge graph to show in the results, an example would be knowledge graph id=/m/0jg24 order online optional can be set to true or false determines whether value serp returns pickup and delivery information for a restaurant business when order online=true a order food property an object of arrays ( delivery and pickup ) details is shown in the result note when order online=true 2 credits are charged instead of 1 for the request (this is due to the increased number of internal requests required to retrieve summarization attributes) flatten results optional can be set to true or false determines whether value serp flattens the inline videos , inline images , inline tweets , top stories and local results and shows them inline with the organic results this is useful if you want a simplified list of all of the results shown for an organic web search, irrespective of the type of result when flatten results=true then a new property type is added to each item in the organic results array indicating the type of result (i e "ad", "inline tweets" etc) include answer box optional determines whether to include the answer box (sometimes called the "featured snippet") in the organic results array and treat it as the first result this may be desirable if you treat the result bing displayed in the answer box as the first organic result ads optimized optional adding the ads optimized=true parameter to the request will optimize the rate that ads are returned in the search fields optional support for google web only enables selection of top level objects to parse if the fields parameter is not provided or is an empty array, all available fields will be parsed (fields="organic results", "top sights" etc) note currently does not support selecting specific subfields within a top level object next steps google search results https //docs trajectdata com/valueserp/search api/results/google/search