Throwing error on `serpapi.search`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by locating the Python implementation of serpapi.search and determine how HTTP errors, especially 429 responses, are currently handled. Use the reported try-catch example as the expected usage pattern, then update the README with error-handling guidance; done means search failures raise a proper error and the documented example explains rate limiting.
Written by the indexing model from the issue text.
Description
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")
sidenote: we should probably update our readme to show how to handle errors.
- Dominant language
- Python
- Stars
- 173
- Forks
- 24
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from serpapi/serpapi-python
-
improvement
Difficulty 5/5 Over a week Newbie friendliness 38/100
serpapi/serpapi-python#27 · 5 comments ·
All issues in serpapi/serpapi-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·