# Google Search API

### Basic Information

**Interface Description:** Retrieve real-time search data from Google via API.

**Interface URL:** <https://scraperapi.thordata.com/request>

**Request Method:** <mark style="color:green;">POST</mark>

### Request parameters

**Headers：**

<table><thead><tr><th width="130">Parameter name</th><th width="130">Type</th><th width="130">Required</th><th>Describe</th></tr></thead><tbody><tr><td><code>token</code></td><td>string</td><td>Yes</td><td>Please log in to the <a href="https://dashboard.thordata.com/account-settings">Dashboard-account-settings</a> to view your <code>token</code></td></tr></tbody></table>

**Body：**

<table><thead><tr><th width="130">Parameter name</th><th width="130">Type</th><th width="130">Required</th><th>Describe</th></tr></thead><tbody><tr><td><code>q</code></td><td>string</td><td>Yes</td><td>Defines the search query for scraping (default: <code>q=pizza</code>). </td></tr><tr><td><code>json</code></td><td>string</td><td>No</td><td>This parameter defines the output format of the crawl results. <br><code>json=1</code> for JSON, <br><code>json=2</code> for both,<br><code>json=3</code> for HTML.</td></tr><tr><td><code>url</code></td><td>string</td><td>Yes</td><td>This defines the domain used during scraping, default is <code>google.com</code>.<br>Modify this or refer to the <a href="https://domains.squarespace.com/">Google Domains page</a> for a full list of supported domains.</td></tr><tr><td><code>gl</code></td><td>string</td><td>No</td><td>Specifies the country/region for localized search results.<br>For supported codes, see <a href="https://developers.google.com/adwords/api/docs/appendix/geotargeting">Google’s Country List</a>.</td></tr><tr><td><code>hl</code></td><td>string</td><td>No</td><td>Sets the UI language for search results <br> Full list:  <a href="https://developers.google.com/google-ads/api/docs/start">Google Language Codes</a>.</td></tr><tr><td><code>cr</code></td><td>string</td><td>No</td><td><p>Restricts results to specific countries using <code>|</code> as a separator  Combine with <code>gl</code> for consistent UI/content language.<code>gl</code> and <code>cr</code> can be combined, but the actual effect follows <strong><code>cr</code></strong> as the priority.</p><p> </p></td></tr><tr><td><code>lr</code></td><td>string</td><td>No</td><td><p>Filters results by language using <code>lang_XX</code> codes . Overrides <code>hl</code> if both are used.</p><p><code>hl</code> and<code>lr</code> can be used together, but the actual effect follows<code>lr</code> as the priority.</p><p> </p></td></tr><tr><td><code>location</code></td><td>string</td><td>No</td><td>Simulates searches from a precise location. Must be paired with <code>uule</code>.</td></tr><tr><td><code>uule</code></td><td>string</td><td>No</td><td>This parameter encodes the selected location using <code>Base64</code>. It is used together with the location parameter.<br>A CSV with all available <code>uule</code> values can be <a href="https://developers.google.com/adwords/api/docs/appendix/geotargeting">downloaded here</a>.</td></tr><tr><td><code>tbm</code></td><td>string</td><td>No</td><td><p>Defines the search result type:</p><ul><li><code>tbm=isch</code> – Images</li><li><code>tbm=shop</code> – Shopping</li><li><code>tbm=nws</code> – News</li><li><code>tbm=vid</code> – Videos</li></ul></td></tr><tr><td><code>start</code></td><td>string</td><td>No</td><td>Set the pagination starting point for search results .Examples:<br><code>start=0</code> (default) - first page of results<br><code>start=20</code> - second page of results<br><code>start=40</code> - third page of results, etc.</td></tr><tr><td><code>num</code></td><td>string</td><td>No</td><td><p>This parameter sets the maximum number of results per page. For example, </p><p><code>num=20</code> (default) - return 20 results<br><code>num=50</code> - return 50 results, etc.</p></td></tr><tr><td><code>safe</code></td><td>string</td><td>No</td><td>This defines whether to filter adult content. Options: <code>active</code> (enabled) or <code>off</code> (disabled).</td></tr><tr><td><code>ludocid</code></td><td>string</td><td>No</td><td>Parameter defines the id (CID) of the Google My Business listing you want to scrape. Also known as Google Place ID.</td></tr><tr><td><code>kgmid</code></td><td>string</td><td>No</td><td>The <code>kgmid</code> parameter is used to directly retrieve encrypted data of specific entries in Google's Knowledge Graph, overriding standard search parameters and returning structured results.</td></tr><tr><td><code>ibp</code></td><td>string</td><td>No</td><td>Used to control layout rendering and expansion effects for specific elements such as knowledge graph expansion search with <code>ludocid</code></td></tr><tr><td><code>tbs</code></td><td>string</td><td>No</td><td>This parameter is used for time/type filtering (supports complex conditions), for example:<br>tbs=qdr:d - Show only content from the last 24 hours<br><code>tbs</code>=qdr:h - Past 1 hour<br><code>tbs</code>=qdr:w - Past 1 week<br><code>tbs</code>=qdr:m - Past 1 month<br><code>tbs</code>=qdr:y - Past 1 year</td></tr><tr><td><code>nfpr</code></td><td>string</td><td>No</td><td>Whether to disable autocorrect spelling, for example: <code>nfpr</code>=1, search for 'googl' will not automatically correct to 'google'</td></tr><tr><td><code>filter</code></td><td>string</td><td>No</td><td>Deduplicates results: <code>1</code> (enable), <code>0</code> (disable).</td></tr></tbody></table>

### Response example

```json
{
    "spider_parameter": {
        "engine": "google",
        "q": "pizza"
    },
    "total": {
        "value": "About 2,240,000,000 results (0.30 seconds) "
    },
    "search_metadata": {
        "created_at": "2025-06-21 14:08:06",
        "id": "xxx",
        "url": "https://www.google.com/search?q=pizza"
    },
    "result":{}
```

<table><thead><tr><th width="160">Parameter Name</th><th width="130">Type</th><th width="130">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>spider_parameter</code></td><td>object</td><td>yes</td><td>Search engine parameters configuration</td></tr><tr><td>   <code>engine</code></td><td>string</td><td>yes</td><td>Search engine type</td></tr><tr><td>   <code>q</code></td><td>string</td><td>yes</td><td>Search keyword</td></tr><tr><td><code>total</code></td><td>object</td><td>yes</td><td>Total search results information</td></tr><tr><td>   <code>value</code></td><td>string</td><td>yes</td><td>Result count and time </td></tr><tr><td><code>search_metadata</code></td><td>object</td><td>yes</td><td>Metadata of the search</td></tr><tr><td>   <code>created_at</code></td><td>string</td><td>yes</td><td>Timestamp of the search </td></tr><tr><td>   <code>id</code></td><td>string</td><td>yes</td><td>Unique task ID</td></tr><tr><td>   <code>url</code></td><td>string</td><td>yes</td><td>Full URL of the search request</td></tr><tr><td><code>result</code></td><td>string</td><td>yes</td><td>Return Result</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.thordata.com/interface-documentation/serp-api/google-search-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
