google-search-results
Python SDK for SerpApi to scrape and parse localized search results from Google, Bing, and more.
Repository Health
Technical Analysis
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()andget_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.
Used by 2 apps in this directory
Firecrawl
AI Development · Developer Tools
Turn any website into clean, LLM-ready data with a single API call — no proxy headaches, no scraping complexity.
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.