Consume Search API
curl --request POST \
--url https://api.glorycloud.com/go-serpapi-server/open/consume \
--header 'Content-Type: application/json' \
--header 'apiKey: <apikey>' \
--data '
{
"query": "Iphone",
"gl": "California,United States",
"lang": "en",
"domain": "com",
"page": 1,
"retry": false,
"hostLang": "en"
}
'import requests
url = "https://api.glorycloud.com/go-serpapi-server/open/consume"
payload = {
"query": "Iphone",
"gl": "California,United States",
"lang": "en",
"domain": "com",
"page": 1,
"retry": False,
"hostLang": "en"
}
headers = {
"apiKey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apiKey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'Iphone',
gl: 'California,United States',
lang: 'en',
domain: 'com',
page: 1,
retry: false,
hostLang: 'en'
})
};
fetch('https://api.glorycloud.com/go-serpapi-server/open/consume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.glorycloud.com/go-serpapi-server/open/consume",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'Iphone',
'gl' => 'California,United States',
'lang' => 'en',
'domain' => 'com',
'page' => 1,
'retry' => false,
'hostLang' => 'en'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glorycloud.com/go-serpapi-server/open/consume"
payload := strings.NewReader("{\n \"query\": \"Iphone\",\n \"gl\": \"California,United States\",\n \"lang\": \"en\",\n \"domain\": \"com\",\n \"page\": 1,\n \"retry\": false,\n \"hostLang\": \"en\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiKey", "<apikey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glorycloud.com/go-serpapi-server/open/consume")
.header("apiKey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Iphone\",\n \"gl\": \"California,United States\",\n \"lang\": \"en\",\n \"domain\": \"com\",\n \"page\": 1,\n \"retry\": false,\n \"hostLang\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.glorycloud.com/go-serpapi-server/open/consume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apiKey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Iphone\",\n \"gl\": \"California,United States\",\n \"lang\": \"en\",\n \"domain\": \"com\",\n \"page\": 1,\n \"retry\": false,\n \"hostLang\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"organic": [
{
"pos": 123,
"pos_overall": 123,
"title": "<string>",
"favicon_text": "<string>",
"url_shown": "<string>",
"url": "<string>",
"desc": "<string>"
}
],
"images": {},
"related_searches": {
"related_searches": [
"<string>"
],
"pos_over_all": 123
},
"people_also_ask": {
"items": [
"<string>"
],
"pos_overall": 123
},
"top_stories": {
"items": [
"<string>"
],
"pos_overall": 123
},
"what_people_are_saying": {},
"total_results_count": null
}
}SERP API
Consume Search API
Execute a search query using the SERP API, returning organic results, related searches, people also ask, top stories, and other search engine result page components.
POST
/
go-serpapi-server
/
open
/
consume
Consume Search API
curl --request POST \
--url https://api.glorycloud.com/go-serpapi-server/open/consume \
--header 'Content-Type: application/json' \
--header 'apiKey: <apikey>' \
--data '
{
"query": "Iphone",
"gl": "California,United States",
"lang": "en",
"domain": "com",
"page": 1,
"retry": false,
"hostLang": "en"
}
'import requests
url = "https://api.glorycloud.com/go-serpapi-server/open/consume"
payload = {
"query": "Iphone",
"gl": "California,United States",
"lang": "en",
"domain": "com",
"page": 1,
"retry": False,
"hostLang": "en"
}
headers = {
"apiKey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apiKey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'Iphone',
gl: 'California,United States',
lang: 'en',
domain: 'com',
page: 1,
retry: false,
hostLang: 'en'
})
};
fetch('https://api.glorycloud.com/go-serpapi-server/open/consume', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.glorycloud.com/go-serpapi-server/open/consume",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'Iphone',
'gl' => 'California,United States',
'lang' => 'en',
'domain' => 'com',
'page' => 1,
'retry' => false,
'hostLang' => 'en'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glorycloud.com/go-serpapi-server/open/consume"
payload := strings.NewReader("{\n \"query\": \"Iphone\",\n \"gl\": \"California,United States\",\n \"lang\": \"en\",\n \"domain\": \"com\",\n \"page\": 1,\n \"retry\": false,\n \"hostLang\": \"en\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiKey", "<apikey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glorycloud.com/go-serpapi-server/open/consume")
.header("apiKey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Iphone\",\n \"gl\": \"California,United States\",\n \"lang\": \"en\",\n \"domain\": \"com\",\n \"page\": 1,\n \"retry\": false,\n \"hostLang\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.glorycloud.com/go-serpapi-server/open/consume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apiKey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Iphone\",\n \"gl\": \"California,United States\",\n \"lang\": \"en\",\n \"domain\": \"com\",\n \"page\": 1,\n \"retry\": false,\n \"hostLang\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"organic": [
{
"pos": 123,
"pos_overall": 123,
"title": "<string>",
"favicon_text": "<string>",
"url_shown": "<string>",
"url": "<string>",
"desc": "<string>"
}
],
"images": {},
"related_searches": {
"related_searches": [
"<string>"
],
"pos_over_all": 123
},
"people_also_ask": {
"items": [
"<string>"
],
"pos_overall": 123
},
"top_stories": {
"items": [
"<string>"
],
"pos_overall": 123
},
"what_people_are_saying": {},
"total_results_count": null
}
}Headers
API key used for authentication.
Body
application/json
Search keywords
Example:
"Iphone"
Geographic location for search results
Example:
"California,United States"
Search language code
Example:
"en"
Search domain (e.g., com, co.uk)
Example:
"com"
Page number, range 1-100
Required range:
1 <= x <= 100Example:
1
Whether to retry on failure
Example:
false
Host language
Example:
"en"
⌘I

