Skip to content

Status Codes

Just Serp API 使用 HTTP 狀態碼和 JSON 響應中的業務邏輯 code 來指示 API 請求的結果。

狀態碼表

ScenarioHTTP StatusBusiness CodeCredits Charged
Success200200✅ Yes
Invalid Parameters200400❌ No
Invalid API Key401401❌ No
Insufficient Credits200402❌ No
Resource Not Found200404❌ No
Rate Limit Exceeded200429❌ No
Internal Server Error500500❌ No

處理錯誤

當發生錯誤時,API 會返回一個包含業務 codemessage 的 JSON 對象,幫助您診斷問題。

錯誤響應示例

json
{
  "code": 401,
  "message": "X-API-Key is missing. Please set X-API-Key header."
}

我們建議對 500 錯誤使用指數退避實現重試邏輯。