googlesearch-python returns empty results (or 429)? A drop-in that works in 2026

googlesearch-python (from googlesearch import search) parses Google's basic, no-JavaScript results page. Google no longer serves that page to scripts, so search() now yields nothing or hits 429 errors (see the library's issue #113). googlesearch-cloud is a drop-in with the same search() arguments and SearchResult objects. It gets live Google results from a hosted endpoint, so you change the import and set an Apify token. In a test on 6 October 2026 from a cloud server, googlesearch-python returned 0 results and googlesearch-cloud returned 12 for each query. Each page of up to 10 results costs $0.005.

Open Google Custom Search API Alternative on Apify $5 per 1,000 searches of up to 10 results ($4 on Gold and above)

Step by step

  1. Create a free Apify account. Sign up at apify.com and copy your API token from Settings → API & Integrations. The free plan's $5 monthly credit covers about 1,000 searches.
  2. Install the package. pip install googlesearch-cloud, or pip install git+https://github.com/retracn/googlesearch-cloud.
  3. Change the import. Replace from googlesearch import search with from googlesearch_cloud import search. Arguments stay the same: num_results, lang, region, safe, advanced, start_num, unique, sleep_interval, proxy.
  4. Set the token. export APIFY_TOKEN=your_token, or pass token=… to search().
  5. Keep your loop. search() is still a generator of URLs, or of SearchResult(url, title, description) with advanced=True.
  6. Allow for live fetching. Each page of 10 results takes about 4–10 seconds (pages are fetched in parallel), so timeout is raised to at least 60 seconds automatically.

Do it from code

Python

# pip install googlesearch-cloud   (or: pip install git+https://github.com/retracn/googlesearch-cloud)
# export APIFY_TOKEN=your_apify_token
from googlesearch_cloud import search   # was: from googlesearch import search

for url in search("best crm for startups", num_results=20):
    print(url)

for r in search("how to learn rust", num_results=5, advanced=True):
    print(r.title, r.url, r.description)

From an AI assistant (MCP)

Add this MCP server URL to Claude, ChatGPT or Cursor and ask in plain English:

https://mcp.apify.com?tools=automationnation/google-custom-search-api

Alternatives

Other options: run Google in a headless browser yourself (slow, and needs proxies on servers), switch to a SERP API such as SerpApi or Serper and rewrite the parsing, or use Google's Custom Search JSON API, which is closed to new customers and shuts down on 1 January 2027.

FAQ

Why does googlesearch-python return an empty list?

It parses Google's basic HTML results page (the version served to clients without JavaScript). Google no longer serves that page to scripts, so the parser finds no results. Rotating user agents or adding sleep doesn't bring it back.

Is it really a drop-in?

The search() signature, the generator behaviour and SearchResult (url, title, description, and the same repr) match googlesearch-python 1.3. The differences are the import name, the Apify token and the longer timeout.

What does it cost?

$5 per 1,000 searches of up to 10 results ($0.005 a page), billed to your Apify account; searches that return nothing are free.

How many results can I get?

Up to 100 per query, which is Google's limit.

Written by AutomationNation, the developer of Google Custom Search API Alternative. Prices checked October 2026.