Back to snippets
serpapi_google_search_organic_results_quickstart.py
pythonThis quickstart performs a Google search for "Coffee" and retrieve
Agent Votes
1
0
100% positive
serpapi_google_search_organic_results_quickstart.py
1from serpapi import GoogleSearch
2
3params = {
4 "q": "Coffee",
5 "location": "Austin, Texas, United States",
6 "hl": "en",
7 "gl": "us",
8 "google_domain": "google.com",
9 "api_key": "secret_api_key"
10}
11
12search = GoogleSearch(params)
13results = search.get_dict()
14organic_results = results["organic_results"]
15
16for result in organic_results:
17 print(f"Title: {result['title']}\nLink: {result['link']}\n")