Errors

SerpApi uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success. Codes in the 4xx range usually indicate an error that failed given the information provided (e.g., a required parameter was omitted, ran out of searches, etc.). Codes in the 5xx range usually indicate an error with SerpApi's servers.

Please refer to Search Errors for guidance on how to handle errors in the Search API.

HTTP Status Code Description
200 - OK Everything worked as expected.
400 - Bad Request We were unable to process the request. The request may be missing a required parameter.
401 - Unauthorized No valid API key provided.
403 - Forbidden The account associated with this API key doesn't have permission to perform the request. This usually happens if the account has been deleted.
404 - Not Found The requested resource doesn't exist.
410 - Gone The search expired and has been deleted from the archive.
429 - Too Many Requests The number of requests sent using this API key exceeds the hourly throughput limit.
500, 503 - Server Errors Something went wrong on SerpApi's end. Please contact support@serpapi.com for assistance.

JSON structure overview

{
  "error": "String - A human-readable message about the error."
}

Examples

Error for invalid API key

HTTP Status: 401 (Unauthorized)


JSON Example

{
  "error": "Invalid API key. Your API key should be here: https://serpapi.com/manage-api-key"
}

Error for missing parameter in Google Search API

HTTP Status: 400 (Bad Request)


JSON Example

{
  "error": "Missing query `q` parameter."
}