Visitar URL original
Throwing error on `serpapi.search` · Issue #17 · serpapi/serpapi-python · GitHub
Skip to content

Throwing error on serpapi.search #17

Description

@hilmanski

The developer team from a high-volume customer reached out that we should throw a proper error on the serpapi.search.

I've suggested using a try-catch exception to handle errors. For example:

try:
    search = serpapi.search(q="CoffeeMilk", api_key="", engine="google", location="Austin, Texas", hl="en", gl="us")
    print(search)
    print("----------------")
except Exception as e:
    if "429" in str(e):
        print("You are being rate limited")
        print(e)
    else:
        print("An error occurred")

Intercom

sidenote: we should probably update our readme to show how to handle errors.

Activity

  1. jvmvik commented on Jul 4, 2025

    @jvmvik
    Contributor

    for high volume workload, I'm in the process of upgrading to aiohttp which x10 faster, and it has a better error handling natively.

  2. jvmvik commented on Feb 16, 2026

    @jvmvik
    Contributor

    0.2.0 is still under development as of Feb 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions