SerpBase
googleAvailable

Google Web Search

Explore the request examples and use this API in the Playground. Account balance and limits apply.

Endpoint and pricing

POSThttps://api.serpbase.dev/google/search

Catalog price: 1 credit per request.

Example request parameters

The sample comes from this product’s catalog. It is not the complete parameter list or required-field rules. See the API documentation; known fields are validated by the API.

Catalog request parameter examples
ParameterExample typeExample value
devicestring"mobile"
glstring"us"
hlstring"en"
qstring"coffee shops"
JSON
{
  "device": "mobile",
  "gl": "us",
  "hl": "en",
  "q": "coffee shops"
}

Request examples

cURL
curl -X POST 'https://api.serpbase.dev/google/search' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"device":"mobile","gl":"us","hl":"en","q":"coffee shops"}'
JavaScript
const response = await fetch("https://api.serpbase.dev/google/search", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_API_KEY"
  },
  "body": "{\"device\":\"mobile\",\"gl\":\"us\",\"hl\":\"en\",\"q\":\"coffee shops\"}"
});
const result = await response.json();
// Check result.status and result.error for the API outcome.
console.log(result);

Response and API outcome

Responses are JSON. HTTP 200 on a search endpoint does not mean the API operation succeeded; inspect status and error. See the API documentation for response fields and errors.

View response documentation
Google Web Search API | SerpBase