# Google Patents API

You have to send a GET request to **`http://api.scrapingdog.com/google_patent`** with the below-given parameters.

Google Patent API pricing is available [here](https://www.scrapingdog.com/google-search-api).

### Parameters

| Parameter                                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>api\_key<br></p><p><mark style="color:red;">required</mark></p> | <p>Type: <em><strong>String</strong></em></p><p></p><p>Your personal API key. Available on your dashboard </p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p>query<br></p><p><mark style="color:red;">required</mark></p>    | <p>Type: <em><strong>String</strong></em><br><br>The parameter specifies the query you wish to search for. You can separate multiple search terms using a semicolon (;). For advanced search syntax, please refer to the "<a href="https://support.google.com/faqs/answer/7049475#zippy=%2Csearching-with-boolean-logic-proximity-in-titleabstractclaims-and-wildcards">About Google Patents</a>" section.<br></p><p>Example for a single search term: (Coffee) OR (Tea)</p><p><br>Example for multiple search terms (separated by a semicolon ;): (Coffee) OR (Tea);(A47J)</p> |
| page                                                               | <p>Type - <strong>String</strong><br><br>Default Value - <strong><code>0</code></strong> <br><br>This is the page number of Google searches. Its value can be 0 for the first page, 1 for the second page, and so on.</p>                                                                                                                                                                                                                                                                                                                                                       |
| num                                                                | <p>Type - <strong>String</strong><br><br>Default Value - <strong><code>10</code></strong> <br><br>Number of results you want to scrape. Its value could be anything between 1 and 100. </p>                                                                                                                                                                                                                                                                                                                                                                                     |
| sort                                                               | <p>Type - <strong>String</strong><br><br>The parameter specifies the sorting method. By default, the results are sorted by Relevance. The supported sorting options are:</p><ul><li><strong>new</strong>: Newest</li><li><strong>old</strong>: Oldest</li></ul><p>For patent results, sorting is based on the filing date, while for scholar results, sorting is done by the publication date for both "new" and "old" values.</p>                                                                                                                                              |
| clustered                                                          | <p>Type - <strong>String</strong><br><br>The parameter determines how the results should be grouped. The available option is:</p><ul><li><strong>true</strong>: Classification</li></ul>                                                                                                                                                                                                                                                                                                                                                                                        |
| dups                                                               | <p>Type - <strong>String</strong><br><br>The parameter defines the deduplication method, which can either be by Family (default) or by Publication. The available value is:</p><ul><li><strong>language</strong>: Publication</li></ul>                                                                                                                                                                                                                                                                                                                                         |
| patents                                                            | <p>Type - <strong>String</strong><br><br>This parameter determines whether Google Patents results are included. (Default is true)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| scholar                                                            | <p>Type - <strong>String</strong><br><br>This parameter determines whether Google Scholar results are included. (Default is false)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| before                                                             | <p>Type - <strong>String</strong></p><p><br>This parameter specifies the maximum date for the results. The format should be type:YYYYMMDD, where 'type' can be one of the following: priority, filing, or publication.</p><p>Example:</p><ul><li>priority:20221231</li><li>publication:20230101</li></ul>                                                                                                                                                                                                                                                                       |
| after                                                              | <p>Type - <strong>String</strong><br><br>This parameter sets the minimum date for the results. The format should be type:YYYYMMDD, where 'type' can be one of the following: priority, filing, or publication.</p><p>Example:</p><ul><li>priority:20221231</li><li>publication:20230101</li></ul>                                                                                                                                                                                                                                                                               |
| inventor                                                           | <p>Type - <strong>String</strong><br><br>This parameter specifies the inventors of the patents. Separate multiple inventors with a comma (,).</p>                                                                                                                                                                                                                                                                                                                                                                                                                               |
| assignee                                                           | <p>Type - <strong>String</strong><br><br>This parameter specifies the assignees of the patents. Separate multiple assignees with a comma (,).</p>                                                                                                                                                                                                                                                                                                                                                                                                                               |
| country                                                            | <p>Type - <strong>String</strong><br><br>This parameter filters patent results by country. Separate multiple country codes with a comma (,).<br>Example: WO,US.<br>A list of supported country codes is available.</p>                                                                                                                                                                                                                                                                                                                                                          |
| language                                                           | <p>Type - <strong>String</strong><br><br>This parameter filters patent results by language. Separate multiple languages with a comma (,).<br>Supported languages include:<br>ENGLISH, GERMAN, CHINESE, FRENCH, SPANISH, ARABIC, JAPANESE, KOREAN, PORTUGUESE, RUSSIAN, ITALIAN, DUTCH, SWEDISH, FINNISH, NORWEGIAN, DANISH.<br>Example: ENGLISH,GERMAN.</p>                                                                                                                                                                                                                     |
| status                                                             | <p>Type - <strong>String</strong><br><br>This parameter filters patent results by their status.<br>Supported values include:<br>GRANT - Grant<br>APPLICATION - Application</p>                                                                                                                                                                                                                                                                                                                                                                                                  |
| type                                                               | <p>Type - <strong>String</strong><br><br>This parameter filters patent results by their type.<br>Supported values include:<br>PATENT - Patent<br>DESIGN - Design</p>                                                                                                                                                                                                                                                                                                                                                                                                            |
| litigation                                                         | <p>Type - <strong>String</strong><br><br>This parameter filters patent results based on their litigation status.<br>Supported values include:<br>YES - Has Related Litigation<br>NO - No Known Litigation</p>                                                                                                                                                                                                                                                                                                                                                                   |

### API Example

{% tabs %}
{% tab title="cURL" %}

```json
curl "https://api.scrapingdog.com/google_patents?query=seat+belt&api_key=APIKEY"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

api_key = "5eaa61a6e562fc52fe763tr516e4653"
url = "https://api.scrapingdog.com/google_patents/"

params = {
    "api_key": api_key,
    "query": "seat+belt"
}

response = requests.get(url, params=params)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Request failed with status code: {response.status_code}")
```

{% endtab %}

{% tab title="Node JS" %}

```javascript
const axios = require('axios');

const api_key = '5eaa61a6e562fc52fe763tr516e4653';
const url = 'https://api.scrapingdog.com/google_patents/';

const params = {
  api_key: api_key,
  query: 'seat+belt'
};

axios
  .get(url, { params: params })
  .then(function (response) {
    if (response.status === 200) {
      const data = response.data;
      console.log(data)
    } else {
      console.log('Request failed with status code: ' + response.status);
    }
  })
  .catch(function (error) {
    console.error('Error making the request: ' + error.message);
  });

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

// Set the API key and request parameters
$api_key = '5eaa61a6e562fc52fe763tr516e4653';
$query = 'seat+belt';

// Set the API endpoint
$url = 'https://api.scrapingdog.com/google_patents/?api_key=' . $api_key . '&query=' . $query;

// Initialize cURL session
$ch = curl_init($url);

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check if the request was successful
if ($response === false) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Process the response data as needed
    echo $response;
}

// Close the cURL session
curl_close($ch);

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'uri'

# Set the API key and request parameters
api_key = '5eaa61a6e562fc52fe763tr516e4653'
query = 'seat+belt'

# Construct the API endpoint URL
url = URI.parse("https://api.scrapingdog.com/google_patents/?api_key=#{api_key}&query=#{query}")

# Create an HTTP GET request
request = Net::HTTP::Get.new(url)

# Create an HTTP client
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true # Enable SSL (https)

# Send the request and get the response
response = http.request(request)

# Check if the request was successful
if response.is_a?(Net::HTTPSuccess)
  puts response.body # Process the response data as needed
else
  puts "HTTP request failed with code: #{response.code}, message: #{response.message}"
end

```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        try {
            // Set the API key and request parameters
            String apiKey = "5eaa61a6e562fc52fe763tr516e4653";
            String query = "seat+belt";

            // Construct the API endpoint URL
            String apiUrl = "https://api.scrapingdog.com/google_patents/?api_key=" + apiKey
                    + "&query=" + query

            // Create a URL object from the API URL string
            URL url = new URL(apiUrl);

            // Open a connection to the URL
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            // Set the request method to GET
            connection.setRequestMethod("GET");

            // Get the response code
            int responseCode = connection.getResponseCode();

            if (responseCode == 200) {
                // Read the response from the connection
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder response = new StringBuilder();

                while ((inputLine = reader.readLine()) != null) {
                    response.append(inputLine);
                }
                reader.close();

                // Process the response data as needed
                System.out.println(response.toString());
            } else {
                System.out.println("HTTP request failed with response code: " + responseCode);
            }

            // Close the connection
            connection.disconnect();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

```

{% endtab %}
{% endtabs %}

### Response

```json
{
    "organic_results": [
        {
            "position": 1,
            "rank": 0,
            "patent_id": "patent/CN101318498B/en",
            "scrapingdog_link": "https://api.scrapingdog.com/google_patents/details?api_key=APIKEY&id=patent/CN101318498B/en",
            "title": "Four point seat belt system",
            "snippet": "A four-point seat belt system for restraining a vehicle occupant in a vehicle seat is disclosed. Two shoulder belts are provided which are buckled together with a pair of lap belts. The convergence of the shoulder belts created at the buckles defines a V-shaped configuration which aids in occupant &hellip;",
            "priority_date": "2007-06-04",
            "filing_date": "2008-06-04",
            "grant_date": "2013-03-20",
            "publication_date": "2013-03-20",
            "inventor": "斯蒂芬·威廉·路哈那",
            "assignee": "福特全球技术公司",
            "publication_number": "CN101318498B",
            "language": "en",
            "thumbnail": "54/b9/9b/c6f095a8237174/S2008101086926E00011.png",
            "pdf": "3c/27/d5/08220e6315bf97/CN101318498B.pdf",
            "figures": [
                {
                    "thumbnail": "08/e4/e2/428ad6c738786f/S2008101086926E00011.png",
                    "full": "c7/ba/17/e75caf681dea72/S2008101086926E00011.png"
                },
                {
                    "thumbnail": "8b/60/db/e9ebc43d4f209f/S2008101086926E00021.png",
                    "full": "a0/9f/2e/56eb667bc25e22/S2008101086926E00021.png"
                },
                {
                    "thumbnail": "4e/44/72/f38107c17086aa/S2008101086926E00031.png",
                    "full": "b5/07/99/6707e4ef33adec/S2008101086926E00031.png"
                },
                {
                    "thumbnail": "f5/7d/42/3b822014e087a2/S2008101086926E00041.png",
                    "full": "f3/d4/e1/d306586a4428d8/S2008101086926E00041.png"
                },
                {
                    "thumbnail": "c4/2d/f3/0a44d6be177562/S2008101086926E00051.png",
                    "full": "3b/86/87/3cd58d95f52b5b/S2008101086926E00051.png"
                },
                {
                    "thumbnail": "3a/60/da/1f190ef9d8ba96/S2008101086926E00061.png",
                    "full": "dc/f2/ed/95a3826552800b/S2008101086926E00061.png"
                }
            ],
            "country_status": {
                "EP": "ACTIVE",
                "US": "ACTIVE",
                "CN": "ACTIVE"
            }
        },
        {
            "position": 2,
            "rank": 1,
            "patent_id": "patent/US7520532B2/en",
            "scrapingdog_link": "https://api.scrapingdog.com/google_patents/details?api_key=APIKEY&id=patent/US7520532B2/en",
            "title": "Seat belt arrangement for child occupants of a vehicle",
            "snippet": "a webbing path adapter having a passageway for receiving a seat belt webbing, the webbing path adapter having a pin for connecting the webbing path adapter to any one of a plurality of holes on the load-bearing plate through the aligned holes in the movable lock plate and the upholstered part of &hellip;",
            "priority_date": "2006-10-30",
            "filing_date": "2007-03-14",
            "grant_date": "2009-04-21",
            "publication_date": "2009-04-21",
            "inventor": "John Bell",
            "assignee": "Key Safety Systems, Inc.",
            "publication_number": "US7520532B2",
            "language": "en",
            "thumbnail": "fb/d5/db/6f393e4dfdf8da/US07520532-20090421-D00000.png",
            "pdf": "11/ff/b6/666c564a6c7f25/US7520532.pdf",
            "figures": [
                {
                    "thumbnail": "f7/94/6d/322452a67a5080/US07520532-20090421-D00000.png",
                    "full": "ce/d3/34/0fd69e878ebfe0/US07520532-20090421-D00000.png"
                },
                {
                    "thumbnail": "74/88/64/eb7444db4c9fb5/US07520532-20090421-D00001.png",
                    "full": "1e/db/ab/410a9853ddf863/US07520532-20090421-D00001.png"
                },
                {
                    "thumbnail": "e1/b2/9b/9eb22a97b3a5ff/US07520532-20090421-D00002.png",
                    "full": "c7/89/0c/e83c53d1192612/US07520532-20090421-D00002.png"
                },
                {
                    "thumbnail": "45/99/c8/bc2c59e647cb66/US07520532-20090421-D00003.png",
                    "full": "08/1e/d2/cb392f4fe2a850/US07520532-20090421-D00003.png"
                },
                {
                    "thumbnail": "6c/14/40/9743ec72fd8897/US07520532-20090421-D00004.png",
                    "full": "34/42/02/10330de9dbfe03/US07520532-20090421-D00004.png"
                },
                {
                    "thumbnail": "cb/17/c7/1bbac735791a18/US07520532-20090421-D00005.png",
                    "full": "f8/9d/5f/eebb6f5c05a987/US07520532-20090421-D00005.png"
                }
            ],
            "country_status": {
                "WO": "ACTIVE",
                "EP": "ACTIVE",
                "US": "ACTIVE",
                "DE": "ACTIVE"
            }
        },
 .....
```


---

# 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://docs.scrapingdog.com/google-patents-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.
