计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
serpapi-common-errors【效率与协作】Classify SerpAPI HTTP failures, search-status failures, and valid empty results before choosing a retry or repair. Use when searches fail, stall, or return unexpected shapes. Trigger with "diagnose a SerpAPI error".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Diagnose the transport, account, search, engine, and application layers separately so retries do not hide configuration or quota failures.
search_metadata.status when a response was createdUse Read, Glob, and Grep to trace request construction and parsing, WebFetch to verify current error semantics, Write or Edit for fixes and redacted evidence, and Bash(python3:*) only for an approved diagnostic using the official client.
SerpAPI uses conventional statuses: 400 for invalid requests, 401 for invalid authentication, 403 for forbidden accounts, 404 for missing resources, 410 for expired archive searches, 429 for either hourly throughput or exhausted searches, and 500/503 for server failures. Search status can be Queued, Processing, Success, or Error; Success can contain empty results.
Keep SERPAPI_KEY out of exceptions and captured request URLs. Use the Account API to classify 429 responses, and share only redacted request metadata or search IDs with support.
error, search status, search ID, engine, safe parameter names, and client timeout.Success with empty sections as data, then inspect documented engine-specific _state fields.Return the failure layer, status and search ID, retryability decision, evidence, corrective change, regression fixture, final state, and support escalation data.
| Signal | Action |
|---|---|
| 400 | Correct parameters; no unchanged retry. |
| 401/403 | Stop; repair authorization or account state. |
| 410 | Re-run only with approval because the archive record expired. |
| 429 | Inspect account throughput and searches left before waiting or changing plan. |
| 500/503 or timeout | Retry within budget; escalate persistent failures with search IDs. |
try:
result = client.search(params)
except serpapi.HTTPError as exc:
if exc.status_code in {400, 401, 403}:
raise PermanentSearchError(exc.status_code) from exc
if exc.status_code == 429:
raise CapacityDecisionRequired() from exc
raise TransientSearchError(exc.status_code) from exc
Keep the new fixture in the offline suite and review retry metrics after the next production window.