SerpBase
Back to Blog

Bulk SERP API: Run Many Google Searches in Parallel with Python

Run a keyword list through the Google search API in parallel with a small asyncio pool: 8 keywords in 8.9 seconds, per-keyword status, cost and rate limits.

November 30, 2026
By SerpBase Team3 min read

Short answer: send several searches at once from a small worker pool and cap the pool at your account's per-second limit. Each keyword is still one ordinary POST /google/search and one credit; there is no special batch endpoint to learn. In our test, 8 keywords with 4 at a time finished in 8.9 seconds against 29.6 seconds of total request time.

Why there is no batch endpoint

Every keyword is a separate Google search, so a "batch" is just many requests. Sending them in parallel from your side gives you the speed of a batch while keeping per-keyword results, errors and retries independent: one slow or failed keyword does not hold up or spoil the rest.

The script we ran

import asyncio, json, time, urllib.request

API_KEY = "YOUR_API_KEY"
QUERIES = ["best crm for startups", "python async tutorial",
           "how to brew pour over coffee", "electric bike reviews",
           "cheap flights to tokyo", "standing desk benefits",
           "learn spanish online", "home solar battery cost"]

def search(q):
    req = urllib.request.Request(
        "https://api.serpbase.dev/google/search",
        data=json.dumps({"q": q, "gl": "us", "hl": "en"}).encode(),
        headers={"Content-Type": "application/json", "X-API-Key": API_KEY},
        method="POST")
    t = time.time()
    with urllib.request.urlopen(req, timeout=40) as r:
        d = json.load(r)
    return q, d.get("status"), len(d.get("organic", [])), d.get("credits_charged"), round(time.time() - t, 1)

async def main(concurrency=4):
    sem = asyncio.Semaphore(concurrency)
    async def run(q):
        async with sem:
            return await asyncio.to_thread(search, q)
    t = time.time()
    results = await asyncio.gather(*(run(q) for q in QUERIES))
    for r in results:
        print(r)
    print("wall", round(time.time() - t, 1), "s")

asyncio.run(main())

It uses only the standard library. asyncio.to_thread runs the blocking request in a thread, and the semaphore keeps at most four in flight.

What came back

Run on 30 November 2026:

KeywordstatusOrganic resultsCreditsSeconds
best crm for startups0915.6
python async tutorial0714.1
how to brew pour over coffee01012.2
electric bike reviews0912.4
cheap flights to tokyo0914.3
standing desk benefits0814.1
learn spanish online0813.6
home solar battery cost0813.3

All eight succeeded for 8 credits. The requests added up to 29.6 seconds; the whole run took 8.9 seconds. Single requests vary from about 2 to 6 seconds, so the run time is set by the slowest ones in each wave, not by the average.

Choosing the pool size

Your limit is per account and per second. Read it from the X-RateLimit-Limit header of any answer, and keep the number of requests you start each second at or below it. A request over the limit is refused with status 1029, is not charged, and can be sent again after the Retry-After header. The rate limit guide shows the retry loop.

Things that trip people up

  • Check status per keyword. The HTTP code is 200 even when a search fails; collect the failed keywords and retry only those.
  • Set a client timeout. We used 40 seconds; see what timeout to set.
  • Failed searches are free; retries are not extra. A retried keyword is charged only when it succeeds.
  • Save as you go. Write each result when it arrives so a crash does not lose the whole run; export to CSV shows a simple format.

Related

Error codes and which to retry: SERP API error codes. Clients in other languages: Python, Node.js and Go.

Cost and docs

Google searches are 1 credit each, however you send them. Credits cost $0.25–$0.50 per 1,000 depending on the plan; new accounts get 500 free credits.