"GoogleCustomSearch" (Service Connection)

Connect to the Google Custom Search API with the Wolfram Language to search the web for sites and images.

Connecting & Authenticating

ServiceConnect["GoogleCustomSearch"] creates a connection to the Google Custom Search API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Use of this connection requires access to the internet and a Google Custom Search API key.
Image search needs to be enabled in Google Custom Search settings in order to use "SearchType""Image".

Requests

ServiceExecute["GoogleCustomSearch","request",params] sends a request to Google Custom Search API, using parameters params. The following give possible requests.

Search Google

Request:

"Search" return web results

Parameters:
  • "Query"(required)search expression
    MaxItems10number of results to show
    "StartIndex"0index of first search result to return
    "SearchType""Web"search type: "Image" or "Web"
    "Site"Nonewebsite constraints on search results
    "FileFormat"Nonefiletype constraints on search results
    LanguageNonelanguage constraints on search results
    "Country"Nonecountry or region constraints on search results
    "ContentFiltering""Off"adult content filtering level ("Off", "Medium" or "High")
    "DateRestrict"Nonerestricts results based on the specified number of past days, weeks, months or years
  • Examples

    Basic Examples  (1)

    Search the web for sites matching a particular query:

    Search the web for images:

    Search the web for specific file formats: