---
title: Search
slug: scaleserp/search-api/searches/google/search
docTags: 
createdAt: 2024-08-03T18:00:34.679Z
---

# Google Search Parameters

<font color="#52c41a">`GET`</font>  `/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/scaleserp/locations-api/overview).

![](https://apiimages.imgix.net/scaleserp/images/png/docs/google_search.png?auto=format\&ixlib=react-9.5.1-beta.1\&w=600 "Google Search Results")

For example, to request videos results for the keyword  `pizza`  in the location  `United States` , the request would be:

:::CodeblockTabs
HTTP

```HTTP
https://api.scaleserp.com/search?api_key=demo&q=pizza&location=United+States
```

```curl
curl -L --get https://api.scaleserp.com/search \
-d api_key="demo" \
-d q="pizza" \
-d location="United+States"
```

```nodejs
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.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);
  })
```

```python
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.scaleserp.com/search', params)

# print the JSON response
print(json.dumps(api_result.json()))
```

```php
<?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.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 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` | adds Google's AI Overview content to the response.<br />* see[ supported langauges by Google country domains](https://data.scaleserp.com/google_supported_languages.json)
* The `query (q)` must be in the supported language of the selected domains. use `German` for `google.de`and `Japanese` for `google.co.jp`<br />Costs **1 additional credit** if an AI Overview is returned<br />* If include\_ai\_overview=false, we’ll return metadata indicating whether an AI Overview is available                                                                                                                                                                                                                                                                                                                        |
| `include_ai_overview_paa` | `optional` | When enabled, includes AI Overview answers in the <br />`related_questions`<br />response for People Also Ask results. Otherwise returns only non-AI Overview answers.<br /><br />Costs **1 additional credit** per AI Overview returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `location`                | `optional` | Determines the geographic location in which the query is executed.  <br />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).  <br />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 Scale SERP [built-in location ](https://docs.trajectdata.com/scaleserp/locations-api/overviewi)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` .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `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/scaleserp/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/scaleserp/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` .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `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.  <br />See the [Pagination ](https://docs.trajectdata.com/scaleserp/search-api/pagination)docs for more information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `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`<br />**    | `optional` | **Support for Google US domain Only**<br />Can be set to `true` or `false` . Determines whether Scale SERP returns pickup and delivery information for a restaurant business. <br />When `order_online=true` a `order_food` property an object of arrays: (`delivery` and `pickup`) details is shown in the result.  <br />**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).<br />                                                                                                                                                                                                                                                                                        |
| `flatten_results`         | `optional` | Can be set to `true` or `false` . Determines whether Scale 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 Google displayed in the `answer_box` as the first organic result.<br /><br />Google AI Overviews is replacing the answer box in many instances.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `ads_optimized`           | `optional` | Adding the ads\_optimized=true parameter to the request will optimize the rate that ads are returned in the search.<br />Costs **3 additional credits.**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `fields`                  | `optional` | **Support for Google Web Only**<br />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).<br />**Note**: Currently does **not** support selecting specific subfields within a top-level object                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

***

**Next Steps**
     [Google Search Results](https://docs.trajectdata.com/scaleserp/search-api/results/google/search)
