"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:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Search the web for images:

In[3]:=
Click for copyable input
Out[3]=

Search the web for specific file formats:

In[4]:=
Click for copyable input
Out[4]=

See Also

ServiceExecute  ▪  ServiceConnect  ▪  BingSearch  ▪  WikipediaData  ▪  WikipediaSearch  ▪  Flickr