GET /google/search

Search

Perform a Google web search and retrieve structured organic results, People Also Ask, and related searches.

Google SERP API

Perform a full Google web search and receive structured results including organic listings, People Also Ask questions, and People Also Search For suggestions. Results are returned in clean JSON format with position tracking for SEO analysis.

HTTP Request

1
GET /google/search

Parameters

ParameterTypeRequiredDefaultDescription
qstringYesThe search query string
numintegerNo10Number of results to return (1-100)
startintegerNo0Result offset for pagination (0-based index)
hlstringNo"en"Language code for the search interface (e.g., en, es, fr)
glstringNo"us"Country code for localized results (e.g., us, uk, de)

Response

The response returns a JSON object containing organic search results and related data.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "real_query": "openai api pricing",
  "organic_results": [
    {
      "title": "Pricing - OpenAI",
      "link": "https://openai.com/pricing",
      "snippet": "Simple and flexible. Only pay for what you use. Start with $5 in free credit that can be used during your first 3 months.",
      "position": 1
    },
    {
      "title": "OpenAI API Pricing Calculator",
      "link": "https://example.com/calculator",
      "snippet": "Calculate your estimated costs for using the OpenAI API based on model and token usage.",
      "position": 2
    }
  ],
  "people_also_ask": [
    "How much does OpenAI API cost?",
    "Is OpenAI API free to use?",
    "What is the rate limit for OpenAI API?"
  ],
  "people_also_search_for": [
    "openai api documentation",
    "chatgpt api pricing",
    "gpt-4 api cost"
  ]
}

Response Fields

FieldTypeDescription
real_querystringThe actual query Google processed
organic_resultsarrayList of organic search results
organic_results[].titlestringTitle of the search result
organic_results[].linkstringURL of the search result
organic_results[].snippetstringText snippet shown in the result
organic_results[].positionintegerPosition of the result (1-based)
people_also_askarrayList of related questions from the People Also Ask box
people_also_search_forarrayList of related search queries

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests

url = "https://google-serp-search-api.p.rapidapi.com/google/search"

querystring = {
    "q": "openai api pricing",
    "num": "10",
    "start": "0",
    "hl": "en",
    "gl": "us"
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "google-serp-search-api.p.rapidapi.com"
}

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

for result in data["organic_results"]:
    print(f"{result['position']}. {result['title']}")
    print(f"   {result['link']}")
    print(f"   {result['snippet']}\n")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const url = "https://google-serp-search-api.p.rapidapi.com/google/search";

const params = new URLSearchParams({
  q: "openai api pricing",
  num: "10",
  start: "0",
  hl: "en",
  gl: "us",
});

const response = await fetch(`${url}?${params}`, {
  method: "GET",
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "google-serp-search-api.p.rapidapi.com",
  },
});

const data = await response.json();

data.organic_results.forEach((result) => {
  console.log(`${result.position}. ${result.title}`);
  console.log(`   ${result.link}`);
  console.log(`   ${result.snippet}\n`);
});
1
2
3
4
5
6
7
8
curl -G "https://google-serp-search-api.p.rapidapi.com/google/search" \
  --data-urlencode "q=openai api pricing" \
  --data-urlencode "num=10" \
  --data-urlencode "start=0" \
  --data-urlencode "hl=en" \
  --data-urlencode "gl=us" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: google-serp-search-api.p.rapidapi.com"
  • Autocomplete — Get search autocomplete suggestions for a query
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI