API Documentation

Complete guide to using the Google Search Results (SERP) API

Overview

A high-performance Google Search Results API wrapper with generous free tier and multiple output formats. Built on Next.js.

1,000 Free Monthly Requests

Generous free tier to get started

Multiple Output Formats

JSON (default), XML, CSV, and minimal formats

Quick Start

curl -X GET "https://search.payloadic.com/api/v1/serp/google/web?q=apple%20inc&gl=us&hl=en" \
  -H "X-RapidAPI-Proxy-Secret: your_secret"

Authentication

This API requires RapidAPI authentication. In production, include the X-RapidAPI-Proxy-Secret header with your subscription secret.

Note:

In local development, authentication is bypassed. The API is only accessible via RapidAPI in production.

API Endpoints

Google Search Results (SERP)

Each search type is available as a dedicated endpoint. Same query parameters and response formats (JSON, XML, CSV, minimal) across all endpoints.

GET /api/v1/serp/google/webWeb Search
GET /api/v1/serp/google/imagesImage Search
GET /api/v1/serp/google/newsNews Search
GET /api/v1/serp/google/placesPlace Search
GET /api/v1/serp/google/videosVideo Search
GET /api/v1/serp/google/shoppingShopping Search

Query Parameters

ParameterTypeRequiredDefaultDescription
qstringYes-Search query string
glstringNousCountry code (ISO 3166-1 alpha-2)
hlstringNoenLanguage code (ISO 639-1)
numintegerNo10Number of results to return (max 100)
tbsstringNo-Time-based search (e.g., "qdr:d" for past day, "qdr:w" for week, "qdr:m" for month, "qdr:y" for year)
pageintegerNo1Page number (1-indexed)
autocorrectbooleanNotrueEnable query autocorrect
formatstringNojsonResponse format: json | xml | csv | minimal

Example Request (Web Search)

curl -X GET "https://search.payloadic.com/api/v1/serp/google/web?q=apple%20inc&gl=us&hl=en&num=10" \
  -H "X-RapidAPI-Proxy-Secret: your_secret"

Example Response (JSON)

{
  "query": {
    "q": "apple inc",
    "gl": "us",
    "hl": "en",
    "num": 10
  },
  "knowledgeGraph": {
    "title": "Apple",
    "type": "Technology company",
    "website": "http://www.apple.com/",
    "description": "Apple Inc. is an American multinational technology company..."
  },
  "organic": [
    {
      "title": "Apple",
      "link": "https://www.apple.com/",
      "snippet": "Discover the innovative world of Apple...",
      "position": 1
    }
  ],
  "peopleAlsoAsk": [
    {
      "question": "What does Apple Inc mean?",
      "snippet": "Apple Inc., formerly Apple Computer, Inc...."
    }
  ],
  "relatedSearches": [
    {
      "query": "Who invented the iPhone"
    }
  ],
  "meta": {
    "timestamp": 1706457600
  }
}

Health Check

GET /api/v1/ping

Returns API health status. No authentication required.

curl -X GET "https://search.payloadic.com/api/v1/ping"
{
  "status": "ok"
}

Response Formats

JSON

?format=json

Standard JSON response with all fields (default)

XML

?format=xml

XML formatted response

CSV

?format=csv

CSV formatted response (organic results only)

MINIMAL

?format=minimal

Simplified JSON with only essential fields

Error Handling

400

Bad Request

Invalid request parameters or validation errors

401

Unauthorized

Missing or invalid RapidAPI authentication header

503

Service Unavailable

Search API errors, rate limits, or timeouts

500

Internal Server Error

Unexpected server errors

Code Examples

JavaScript (Fetch)

const response = await fetch(
  'https://search.payloadic.com/api/v1/serp/google/web?q=apple&gl=us&hl=en',
  {
    headers: {
      'X-RapidAPI-Proxy-Secret': 'your_secret'
    }
  }
);
const data = await response.json();
console.log(data);

Python (Requests)

import requests

url = "https://search.payloadic.com/api/v1/serp/google/web"
params = {
    "q": "apple",
    "gl": "us",
    "hl": "en"
}
headers = {
    "X-RapidAPI-Proxy-Secret": "your_secret"
}

response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)

Node.js (Axios)

const axios = require('axios');

const response = await axios.get(
  'https://search.payloadic.com/api/v1/serp/google/web',
  {
    params: {
      q: 'apple',
      gl: 'us',
      hl: 'en'
    },
    headers: {
      'X-RapidAPI-Proxy-Secret': 'your_secret'
    }
  }
);

console.log(response.data);