serpapi
The official Python client for SerpApi.com.
What it is and what it does
serpapi is the official Python wrapper for SerpApi.com, a search engine aggregation service. It lets you query results from Google, Bing, Baidu, Yahoo, eBay, YouTube, Walmart, DuckDuckGo, Naver, and other engines through a unified client interface, returning structured JSON-like results. The package handles authentication via API key, timeouts, and error cases (HTTPError for bad requests or auth failures, TimeoutError for slow responses).
You instantiate a Client with your API key, call search() with an engine name and query parameters, and get back a SerpResults object that behaves like a dictionary. The package is designed for integration into AI workflows, RAG pipelines, fine-tuning datasets, and data mining at scale. It depends only on requests for HTTP transport.
Use it for:
- Fetch Google search results programmatically for web scraping or data collection pipelines.
- Query e-commerce platforms (eBay, Walmart) for product listings and pricing data at scale.
- Integrate search results into machine learning training datasets or RAG (retrieval-augmented generation) systems.
- Build multi-engine search aggregators that query Bing, Baidu, or Yahoo in a single codebase.
- Retrieve structured data like news headlines, stock market data, or flight schedules via SerpApi's supported engines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Official Python client for SerpApi that queries multiple search engines and data sources (Google, Bing, Baidu, Yahoo, eBay, YouTube, and others) and returns structured results as dictionary-like objects.
Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and provides a clean, documented interface to a large set of search engines. Install it if you need programmatic access to search results or structured data from multiple sources. The main gotcha is that it requires a SerpApi account and API key, so verify pricing and rate limits for your use case before committing.
Install
serpapi on PyPI
pip
pip install serpapiuv
uv add serpapipoetry
poetry add serpapiInstalling serpapi
Before you install
Low install friction with a single dependency (requests) and a pure-wheel distribution. The package is actively maintained with a recent release and 166 repository stars, supporting Python 3.6 through 3.14.
License in practice
MIT license is permissive and places no restrictions on use, modification, or redistribution in commercial or private projects.
Quickstart
import os
import serpapi
client = serpapi.Client(api_key=os.getenv("SERPAPI_KEY"))
results = client.search({
"engine": "google",
"q": "coffee"
})
print(results)
Requires a valid SerpApi API key (obtainable from serpapi.com/users/sign_up) and network access to SerpApi's backend service.
Verify before relying
- Whether the SerpApi service itself requires a paid subscription or if free tier access is available for all supported engines
- Rate limiting or throughput constraints imposed by the SerpApi backend service
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 576,023/month — #5,932 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: serpapi-1.1.0-py3-none-any.whl
Keywords: scrape, serp, api, serpapi, scraping, json, search, localized, rank, google, bing, baidu, yandex, yahoo, ebay, scale, datamining, training, machine, ml, youtube, naver, walmart, apple, store, app
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
google-search-resultsA Python client for querying search results…
permissive · top 5,000 on PyPI
dataforseo-clientA Python client library for the DataForSEO REST…
unclear · top 15,000 on PyPI
ebaysdkProgrammatic interface to eBay's Finding,…
copyleft · top 15,000 on PyPI
ddgsAggregates web search results from multiple…
permissive · top 5,000 on PyPI
scrapingbeePython SDK wrapper for ScrapingBee's web…
permissive · top 15,000 on PyPI
tavily-pythonPython SDK for the Tavily API, providing web…
permissive · top 5,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
brightdata-sdkOfficial Python SDK for Bright Data APIs,…
permissive · top 15,000 on PyPI
aistudio-sdkPython client library for the AIStudio API,…
permissive · top 5,000 on PyPI
googlesearch-pythonScrapes Google search results by sending HTTP…
permissive · top 5,000 on PyPI