google site search api

[SOLVED] Google site search API simplified 2020

Rate this article

Share this article

Google site search API (now custom search API since Google site search is shutting down) lets you develop applications to get and show results from Google custom/ site search programmatically. Google site search In this article we will discuss the components of the google site search API and where to find them. Google search for sites has many restrictions and you could sign up for expertrec site search engine using the link below.


Create your custom search engine


Google site search API Call

The usual API call is

Google search API query parameters

Here parameters could be –

  1. q– query string
  2. cx– Custom search engine ID.
  3. fileType– bmp, gif, jpg, png, pdf etc
  4. num-number of search results to display
  5. searchType- search type.
  6. sort-Sort by functionality to use.

For a list of all query parameters, go to this link.

google site search API


A sample API call would be like this-{YOUR_API_KEY}&cx={CUSTOM_SEARCH_ENGINE_ID}&q={KEYWORD}

The response of this API will be in JSON format for you to consume to build your search application.

google site search api

Getting your API Key

  1. Go to
  2. Click on the get site search api
  3. Click to create a new site search api
  4. This will generate your new API site search api
  5. You can restrict the usage of this API key in your google API console

google site search api

Getting your CX / Search engine ID:

Go to your custom search / site search control panel-> edit search engine->Basics->Details->Search engine ID.

This is your search engine ID.

google site search api

If you are finding issues with the Google site search API, you could try out expertrec’s site search API, which is easier to implement.

Expertrec’s Google site search replacement API-

Go to  and enter your website and sitemap URLs to get your crawl done. Go and click on your demo link.

Create your custom search engine

  1. In your demo link open developer tools (control+shift+I) on your chrome browser.
  2. Go to the network tab.
  3. Go to the XHR section.
  4. Search for expertrec.
  5. Click on searchv7…

google site search api

The API will be of this format-{org_id}/?q={keyword}&page={pagination}&size={number_of_search_results}

Expertrec site search API parameters-

  1. org_id- Your unique ID that identifies your website/ websites.
  2. q- Keyword.
  3. page- pagination
  4. size- number of search results to be displayed.

The results will be in JSON format and will be similar to this screenshot-


Create your custom search engine

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like