brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
serpapi-webhooks-eventsImplement SerpAPI asynchronous searches and scheduled change detection without inventing a webhook callback contract. Use when building long-running searches or SERP monitoring. Trigger with "build SerpAPI async monitoring".
Independent GitHub snapshot · Automated classification · Original documentation governs
Use documented async submission plus Searches Archive polling, or scheduled synchronous searches, with explicit state, budgets, and reconciliation.
Use Read, Glob, and Grep to inspect jobs and consumers, WebFetch to verify async and archive contracts, and Write or Edit for state machines, schedules, checkpoints, fixtures, and redacted receipts.
SerpAPI documents async=true to submit without holding the connection and the Searches Archive API to retrieve the search by ID. Status can move through queued or processing to success or error. async must not be combined with no_cache and is not for accounts with Ludicrous Speed. The public contract does not define a generic callback webhook for completed searches.
Use SERPAPI_KEY in the server-side submitter and poller. Persist search IDs and safe state, never key-bearing archive URLs. Authenticate and authorize any downstream notification endpoint using its own documented mechanism.
SUBMITTED, QUEUED, PROCESSING, SUCCEEDED, FAILED, EXPIRED, and TIMED_OUT with terminal behavior."async": true; persist the search ID, normalized request hash, owner, deadline, and attempt budget.Do not create a production schedule, send live searches, expose a notification endpoint, or mutate downstream records without named owners.
Return the selected sync/async mode, state machine, polling and search budgets, checkpoint schema, idempotency key, fixture results, schedule/canary receipt, and reconciliation outcome.
| Condition | Response |
|---|---|
| Search remains queued/processing | Stop at the deadline and retain resumable state. |
| Archive returns 410 | Mark expired and require approval before submitting a replacement search. |
Async is paired with no_cache | Reject the request locally. |
| Callback contract is requested | Use polling or obtain a current written vendor-specific contract; do not invent a webhook. |
submitted = client.search({"engine": "google", "q": "coffee", "async": True})
search_id = submitted["search_metadata"]["id"]
while before_deadline():
archived = client.search_archive(search_id=search_id)
status = archived["search_metadata"]["status"]
if status in {"Success", "Error"}:
break
wait_with_jitter()
Canary one bounded async job and verify terminal-state, capacity, and checkpoint reconciliation before scheduling recurrence.