πŸ”Google Search

Google Search API

Search for information from Google with some query and retrieve the search result.

Examples

Query suggestions

Search Elon Musk twitter acquisition
Search Elon Musk twitter acquisition on site bbc.com/news

Processing the outputs

The output data has the following structure.

{
    "searchParameters": {
    "q": "NSFOCUS Inc (HKG) site:peeringdb.com/net",
    "gl": "us",
    "hl": "en",
    "num": 10,
    "autocorrect": true,
    "page": 1,
    "type": "search"
  },
  "organic": [
    {
      "title": "NSFOCUS, Inc. - PeeringDB",
      "link": "https://www.peeringdb.com/net/9904",
      "snippet": "NSFOCUS, Inc. Organization. NSFOCUS, Inc. Also Known As. Long Name. Company Website. http://www.nsfocusglobal.com ... Equinix Hong Kong. 8757. Operational.",
      "position": 1
    }
  ]
}

Output processing commands can be specified to extract and process the output data, e.g.

Search NSFOCUS Inc on site peeringdb.com/net. 
If "organic" field has more than one item, then look at the first result. If the first result's title has " - " then return the text before " - ", else look at snippet and return the text before ". ". Otherwise return empty.

Last updated