Google Search

Introduction

To perform a search on Google using the REST APIs, we need to create a Custom Search Engine (referred from now on as CSE). We also need to enable Custom Search API for the account using which we are going to create CSE.

Google Search Service on Intelligence Platform needs 2 IDs to execute the search operation, CSE ID and Custom Search API Key. The free version of CSE only allows upto 100 searches/day using a single ID/Key pair. After that, the ID/Key Pair expires and is reset the next day.

IMPORTANT: Please make sure your Google Search instance must be accessible from the Gathr Analytics Machine.

API Rate Limit: 10000 requests per day

Steps to create Credentials

Following are the steps to create CSE ID and API Key for your account –

  1. Steps to create CSE ID
  2. Open https://cse.google.com/ and login using your personal account.
  3. Click “New Search Engine”.
  4. In “Site to Search” enter www.example.com.
  5. Select language as English.
  6. Provide a name to the search engine and click “Create”.
  7. Click on “Edit Search Engine” and select the search engine created in steps above.
  8. Click on “Setup”.
  9. Click “Search Engine ID” button and save the ID (say ‘cx’). This will be required in later part of the document.
  10. Turn on “Search the entire web” down to “Site to Search”.
  11. Select www.example.com and click delete.
  12. Click Update.

Steps to Enable Custom Search API

  1. Open https://console.developers.google.com and login using your personal account.
  2. In the Top Left section, click the drop-down “Select a Project” and click “Create a Project”.
  3. Fill the Project name, click no for “email updates” and “yes” to “agree terms and conditions” and click “Create” button.
  4. Click on “Enable APIs and Services” and search for “Custom Search API” in “Google APIs” tab.
  5. Click on “Custom Search API” in search results and click “Enable” on the following page.

Steps to Create API Key

  1. After “Enabling”, click on “Go to Credentials”.
  2. Click on “CREATE CREDENTIALS” and it will give you an API Key.
  3. Save the key(say ‘key’) as it will be required in later part of the document.

Configuration on Gathr Analytics

To configure Google Search using Token based authentication, follow the steps below:-

  1. Right click on the floor, go to Connectors→ Import.

  2. Import the Google Search Connector.zip file.

  3. Right click on the floor, go to Connectors→ Show.

  4. Right click on the entity of column “Google Search Connector” and go to Connectors → Connections → Configure.

  5. Enter Google Search URL i.e. https://www.googleapis.com

  6. Select “Create New Account” and add user friendly name for account “Google Search Account”

  7. Select Authentication Type as “Token” and enter the details for the below Token Parameters:

    • Token Parameter key : “cx”

    • value :

      • Click the plus icon (’+’) present at the end of this row to add a new token parameter and add
    • Token Parameter key : “key”

    • value :

      • Please refer the below image to get more clarity.
  8. Click on “Save”.

Top