Google Search

The Google Search data connector allows users to leverage the Google Search engine.

#Release Stage

Alpha

#Resource Configuration

The up-to-date configuration is maintained here

FieldTypeNote
api_key*stringAPI Key for the Google Custom Search API. You can create one here
cse_id*stringID of the Search Engine to use. Before using the Custom Search JSON API you will first need to create and configure your Programmable Search Engine. If you have not already created a Programmable Search Engine, you can start by visiting the Programmable Search Engine control panel. You can find this in the URL of your Search Engine. For example, if the URL of your search engine is https://cse.google.com/cse.js?cx=012345678910, the ID value is: 012345678910"

#No-code Setup

To create a Google Search connector effortlessly, follow these steps:

  1. Go to the Resource page and click Add Resource
  2. Select Google Search
  3. Fill in a unique ID for the resource. Optionally, give a short description in the Description field
  4. Fill in the required fields.

#Low-code Setup

cURL(Instill-Cloud)
cURL(Instill-Core)
Copy

curl -X POST https://api.instill.tech/vdp/v1alpha/users/<user-id>/connector-resources \
--header 'Authorization: Bearer <Instill-Cloud-API-Token>' \
--data '{
"id": "my-google-search-engine",
"connector_definition_name": "connector-definitions/data-google-search",
"configuration": {
"api_key": "<open-ai-api-key>",
"cse_id": "<search-engine-id>"
}
}'

#Connector Configuration

When using the Google Search connector in your pipeline, certain fields of the input data need to be filled to trigger the pipeline effectively. Here are the expected input and output data fields for the connector.

If task is set to TASK_SEARCH

InputTypeDescription
task*stringTASK_TEXT_GENERATION
query*stringThe search query for Google.
top_kintThe number of results to return for each query. Default to 10.
include_link_textbooleanIndicate whether to scrape the link and include the text of the link associated with this search result in the 'link_text' field". Default to false.
include_link_htmlbooleanIndicate whether to scrape the link and include the raw HTML of the link associated with this search result in the 'link_html' field". Default to false.
OutputTypeDescription
resultsarray[object]The returned search results from Google. Each result include the following fields:
- title: The title of a search result, in plain text;
- link: The full URL to which the search result is pointing, e.g., http://www.example.com/foo/bar
- snippet: The snippet from the page associated with this search result, in plain text
- link_text: The scraped text of the link associated with this search result, in plain text
- link_html: The scraped raw HTML of the link associated with this search result

#Example

Example input and output data for each task:

TASK_SEARCH
Copy

// Input
{
"task": "TASK_SEARCH",
"query": "What's today's date?",
"top_k": 5,
"include_link_text": true,
"include_link_html": true
}
// Output
{
"results": [
{
"link": "https://www.saturdaygift.com/todays-date/",
"snippet": "Thursday, November 09, 2023 路 Today's day number is: 313 (of 365) 路 There are 52 days remaining in this year 2023. 路 The current week number: 45 (of 52) 路 The聽...",
"title": "What Is Today's Date? What Day Is It?",
"link_html": "<!DOCTYPE html><html lang=\"en-US\" class=\"no-js...",
"link_text": "On This Day - What Happened Today In History | Britannica\n Subscribe Subscribe Ho..."
},
...
]
}

Last updated: 11/11/2023, 2:41:35 PM