'position': 3}]}
Some examples of the tbs parameter:
qdr:h (past hour)
qdr:d (past day)
qdr:w (past week)
qdr:m (past month)
qdr:y (past year)
You can specify intermediate time periods by adding a number:
qdr:h12 (past 12 hours)
qdr:d3 (past 3 days)
qdr:w2 (past 2 weeks)
qdr:m6 (past 6 months)
qdr:m2 (past 2 years)
For all supported filters simply go to Google Search, search for something, click on “Tools”, add your date filter and check the URL for “tbs=”.
Searching for Google Places#
We can also query Google Places using this wrapper. For example:
search = GoogleSerperAPIWrapper(type="places")
results = search.results("Italian restaurants in Upper East Side")
pprint.pp(results)
{'searchParameters': {'q': 'Italian restaurants in Upper East Side',
                      'gl': 'us',
                      'hl': 'en',
                      'num': 10,
                      'type': 'places'},
 'places': [{'position': 1,
             'title': "L'Osteria",
             'address': '1219 Lexington Ave',
             'latitude': 40.777154599999996,
             'longitude': -73.9571363,
             'thumbnailUrl': 'https://lh5.googleusercontent.com/p/AF1QipNjU7BWEq_aYQANBCbX52Kb0lDpd_lFIx5onw40=w92-h92-n-k-no',
             'rating': 4.7,
             'ratingCount': 91,
             'category': 'Italian'},
rtdocs_stable/api.python.langchain.com/en/stable/modules/agents/tools/examples/google_serper.html