Skip to main content
Google SERP (Search Engine Results Page) is the results page that users see after entering a query in the Google search engine. It displays organic search results, advertisements, featured snippets, knowledge graphs, and various types of content such as images and videos, aiming to provide users with the most relevant information. This article will introduce the Google SERP API in detail. It can provide results for queries entered in the Google search engine, and the result content also includes many types, such as featured snippets, knowledge graphs, images, and various other results. This document will introduce the integration guide for the Google SERP API.

Application Process

To use the Google SERP API, first go to the Ace Data Cloud Console to obtain your API Token and keep it for later use. If you have not logged in or registered yet, you will be automatically redirected to the login page to register and log in. After completion, you will automatically return to the current page. One API Token can call all services on the platform, with no need to apply separately for each service. The first application will receive free credits for a free trial; when credits are insufficient, you can recharge the general balance in the Console.
📘 Complete documentation: Google SERP API →

Basic Usage

Enter keywords and the search resource type to obtain results: use query to pass keywords, and use type to select search types such as web pages, images, news, and more; this API does not require passing model. For example, to search for information about “apple inc,” we can then fill in the corresponding content in the interface, as shown in the image:

You can see that we have set the Request Headers here, including:
  • accept: The format of the response result you want to receive. Here it is set to application/json, which is JSON format.
  • authorization: The key for calling the API. After applying, you can directly select it from the dropdown.
In addition, the Request Body has been set, including:
  • type: The type of search resource. Currently, only six types are supported, and the default is search.
  • query: The search keyword.
  • country: The country where the search results are located. The default is the United States (US).
  • language: The language of the search results. The default is English (en).
  • range: The time range of the search results. The default has no restriction.
  • number: The page size for pagination of the search results. The default is 10.
  • page: The page number for pagination of the search results. The default is 1.
After making the selection, you can find that the corresponding code is also generated on the right side, as shown in the image:

Click the “Try” button to test it. As shown in the image above, we obtain the following result here:
The returned result contains multiple fields in total, which are described as follows:
  • knowledge_graph, the knowledge graph of the search results.
  • organic, the detailed information of the search results.
  • people_also_ask, questions related to the search keyword.
  • related_searches, related searches for the search keyword.
As you can see, there is an organic field in the returned results here, which mainly contains the results for the search keyword. Additionally, if you want to generate the corresponding integration code, you can directly copy and generate it. For example, the CURL code is as follows:
The Python integration code is as follows:

Custom Search Types

If you customize the type of search resources, we can modify the type parameter. It includes general resources search, image resources images, news resources news, map resources maps, local resources places, and video resources videos. This article will use video resources videos as an example. Next, let us demonstrate the specific operation. First, set the type parameter to videos, and pass the query parameter normally, as shown in the figure:

The corresponding code is as follows:
The following response can be obtained:
The returned result contains multiple fields, described as follows:
  • news, a list of video information in the search results.
As you can see, there is a videos field in the returned result, which mainly contains the results for the search keyword.

Customize the Country Where the Search Resource Is Located

This API also supports limiting the country where the search results are located. We can add the country parameter to limit the country. The input parameter is the abbreviation of the country, such as cn (China) and us (United States). This article will use China as the following example. The specific information is as follows:

The output is as follows:
It can be seen that the results are search results in the China country, and the specific content is similar to the above.

Customize Search Result Language

We can also customize the language of the search results. Here, we additionally add the language field, with the value zh-cn, which refers to the language of Simplified Chinese. Other languages are also supported, but you must enter the abbreviation of the language, such as en (English), fr (French), zh-cn (Chinese (Simplified)), and so on, as shown in the figure:

The corresponding code is as follows:
The execution result is as follows:
You can see that the results displayed here are all in Simplified Chinese, and the content of the results is similar to the above.

Customize the Search Result Time Range

This article also allows you to customize the time range of search results, including five options: qdr:h (past hour), qdr:d (past day), qdr:w (past week), qdr:m (past month), and unlimited by default. We can pass the corresponding time range through range. For example, here it is set to qdr:d, which means searching for results from the past day, so the input is as follows:

The corresponding code is as follows:
The result is as follows:
As you can see, we successfully obtained the search results from the past day, and the result content is similar to the above.

Customize Search Result Pagination

This API also supports customized paginated display of search results. number and page represent the page size and page number for pagination. This article will set 20 search results per page for paginated display. The specific information is shown in the figure:

Note: When the number of results per page exceeds 10, the deducted credits will be doubled.
The code is as follows:
The execution result is as follows:
It can be seen that here it displays the search results in pages, with 20 results displayed on each page, and the content of the results is similar to the above.