google-search-results

Python SDK for SerpApi to scrape and parse localized search results from Google, Bing, and more.

SDK
PyPI
v2.4.2
753stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
55/100Fair
Development Activity56
Maintenance4
Community72
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture70
Code Quality68
Innovation65
Learning Curve88

google-search-results is the legacy Python client for SerpApi, a hosted service that scrapes and returns structured JSON search results from Google, Bing, Baidu, Yandex, Yahoo, eBay, Home Depot, YouTube, Walmart, the Apple App Store, and other engines. It wraps SerpApi’s Search, Search Archive, Account, and Location APIs behind engine-specific classes such as GoogleSearch and BingSearch.

You supply query parameters and your API key, and the library handles the HTTP request, response parsing, pagination, and error handling, returning results as Python dictionaries. Note that the maintainers plan to deprecate this package in favor of the newer serpapi client.

What You Get

  • Engine-specific client classes (GoogleSearch, BingSearch, BaiduSearch, YandexSearch, and more)
  • Structured JSON/dict results via get_json() and get_dict() helpers
  • Built-in pagination support for iterating over multi-page result sets
  • Access to SerpApi’s Search Archive, Account, and Location APIs

Common Use Cases

  • Collecting SERP data for rank tracking and SEO monitoring
  • Building datasets from search results for research or machine learning
  • Programmatically querying multiple search engines through one unified API

Under The Hood

Architecture - The serpapi/ package centers on serp_api_client.py, whose SerpApiClient builds the request URL, injects source=python and the API key, issues a requests.get against https://serpapi.com, and parses JSON. Each engine (google_search.py, bing_search.py, baidu_search.py, etc.) is a thin subclass that presets the engine parameter, while pagination.py iterates result pages and serp_api_client_exception.py wraps API errors.

Tech Stack - Pure Python (3.5+ per setup.py, though 3.7+ is recommended) with a single runtime dependency, requests. Packaging is classic setuptools with find_packages.

Code Quality - Each engine class has a corresponding test under tests/ (e.g. test_google_search.py, test_walmart_search.py), giving broad per-engine coverage, though tests hit the live API and require a key. Code is straightforward but light on type hints and modern typing.

API Design - The developer experience is very approachable: instantiate an engine class with a params dict, call get_dict() or get_json(), and you have parsed results. The trade-off is a somewhat dated design (dict-based params, mutable class-level key) that the successor serpapi package aims to modernize.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search