Searching for Google News#
We can also query Google News using this wrapper. For example:
search = GoogleSerperAPIWrapper(type="news")
results = search.results("Tesla Inc.")
pprint.pp(results)
{'searchParameters': {'q': 'Tesla Inc.',
                      'gl': 'us',
                      'hl': 'en',
                      'num': 10,
                      'type': 'news'},
 'news': [{'title': 'ISS recommends Tesla investors vote against re-election '
                    'of Robyn Denholm',
           'link': 'https://www.reuters.com/business/autos-transportation/iss-recommends-tesla-investors-vote-against-re-election-robyn-denholm-2023-05-04/',
           'snippet': 'Proxy advisory firm ISS on Wednesday recommended Tesla '
                      'investors vote against re-election of board chair Robyn '
                      'Denholm, citing "concerns on...',
           'date': '5 mins ago',
           'source': 'Reuters',
           'imageUrl': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROdETe_GUyp1e8RHNhaRM8Z_vfxCvdfinZwzL1bT1ZGSYaGTeOojIdBoLevA&s',
           'position': 1},
          {'title': 'Global companies by market cap: Tesla fell most in April',
           'link': 'https://www.reuters.com/markets/global-companies-by-market-cap-tesla-fell-most-april-2023-05-02/',
           'snippet': 'Tesla Inc was the biggest loser among top companies by '
                      'market capitalisation in April, hit by disappointing '
                      'quarterly earnings after it...',
rtdocs_stable/api.python.langchain.com/en/stable/modules/agents/tools/examples/google_serper.html