Google Search
curl --request GET \
--url https://api.example.com/google/searchimport requests
url = "https://api.example.com/google/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/google/search', 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.example.com/google/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/google/search"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/google/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/google/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodySearch Engines
Google Search
Execute a Google search and retrieve parsed results with organic listings, ads, and more
GET
/
google
/
search
Google Search
curl --request GET \
--url https://api.example.com/google/searchimport requests
url = "https://api.example.com/google/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/google/search', 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.example.com/google/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/google/search"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/google/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/google/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyOverview
The/google/search endpoint executes a Google search query and returns parsed, structured results. This API handles anti-bot measures and provides clean data extraction from Google’s search results.
Parameters
Query Parameters
string
required
The search query
string
default:"en"
Language code for the interface (e.g.,
en, es, fr, de)string
default:"us"
Country code for geo-targeted results (e.g.,
us, uk, de, jp)number
default:"10"
Number of results to return (1-100)
number
default:"0"
Start offset for pagination (e.g.,
0 for first page, 10 for second)string
default:"desktop"
Device type to emulate. Options:
desktop, mobile, tabletstring
Location for geo-targeted results (e.g.,
New York, USA, London, UK)string
Safe search mode. Options:
off, medium, highstring
Time-based filter for results:
qdr:d- Past 24 hoursqdr:w- Past weekqdr:m- Past monthqdr:y- Past year
string
default:"search"
Search type. Options:
search, images, news, videosnumber
Duplicate content filter.
0 = show all, 1 = filter duplicatesnumber
Auto-correct toggle.
0 = allow corrections, 1 = disable auto-correctstring
Encoded location in UULE format for precise geo-targeting
string
default:"www.google.com"
Google domain to use (e.g.,
www.google.co.uk, www.google.de)boolean
default:"false"
Return raw HTML instead of parsed results
boolean
default:"false"
Async mode - returns job ID immediately for later retrieval
Example Requests
Basic Search
curl -X GET "https://api.scrapengine.io/api/v1/google/search?q=best%20coffee%20shops&gl=us&num=10" \
-H "Authorization: Bearer YOUR_API_KEY"
const params = new URLSearchParams({
q: "best coffee shops",
gl: "us",
num: "10",
});
const response = await fetch(
`https://api.scrapengine.io/api/v1/google/search?${params}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://api.scrapengine.io/api/v1/google/search"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {
"q": "best coffee shops",
"gl": "us",
"num": 10
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
Location-Targeted Search
curl -X GET "https://api.scrapengine.io/api/v1/google/search?q=restaurants&location=New%20York%2C%20USA&device=mobile" \
-H "Authorization: Bearer YOUR_API_KEY"
const params = new URLSearchParams({
q: "restaurants",
location: "New York, USA",
device: "mobile",
});
const response = await fetch(
`https://api.scrapengine.io/api/v1/google/search?${params}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://api.scrapengine.io/api/v1/google/search"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {
"q": "restaurants",
"location": "New York, USA",
"device": "mobile"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
News Search with Time Filter
curl -X GET "https://api.scrapengine.io/api/v1/google/search?q=technology&tbm=news&tbs=qdr:d" \
-H "Authorization: Bearer YOUR_API_KEY"
const params = new URLSearchParams({
q: "technology",
tbm: "news",
tbs: "qdr:d",
});
const response = await fetch(
`https://api.scrapengine.io/api/v1/google/search?${params}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://api.scrapengine.io/api/v1/google/search"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {
"q": "technology",
"tbm": "news",
"tbs": "qdr:d"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
Response
Success Response (200)
Returns parsed search results with organic listings, ads, and other components:{
"searchInformation": {
"totalResults": "1250000000",
"searchTime": 0.45
},
"organicResults": [
{
"position": 1,
"title": "Best Coffee Shops in NYC - Top 10 List",
"link": "https://example.com/best-coffee-nyc",
"displayLink": "example.com",
"snippet": "Discover the best coffee shops in New York City with our curated list of local favorites and hidden gems...",
"date": "2024-01-10"
},
{
"position": 2,
"title": "Coffee Shop Guide 2024",
"link": "https://coffeeguide.com/nyc",
"displayLink": "coffeeguide.com",
"snippet": "Your complete guide to finding the perfect coffee shop..."
}
],
"ads": [
{
"position": 1,
"title": "Premium Coffee Shop Equipment",
"link": "https://ads.example.com/coffee-equipment",
"displayLink": "ads.example.com",
"description": "Shop professional coffee equipment at competitive prices"
}
],
"relatedSearches": [
"best coffee shops near me",
"coffee shops with wifi",
"specialty coffee shops"
],
"pagination": {
"current": 1,
"next": "https://api.scrapengine.io/api/v1/google/search?q=best+coffee+shops&start=10"
}
}
Response Headers
| Header | Description |
|---|---|
x-remaining-credits | Number of API credits remaining |
x-trace-id | Unique identifier for the request |
Error Responses
| Status | Description |
|---|---|
400 | Bad Request - Invalid query parameters |
401 | Unauthorized - Invalid or missing API key |
500 | Internal Server Error |
Use Cases
- SEO monitoring: Track keyword rankings and SERP positions
- Competitor analysis: Monitor competitor visibility in search results
- Market research: Analyze search trends and popular content
- Lead generation: Find businesses and contact information
- Content research: Discover trending topics and content gaps
- Ad monitoring: Track competitor advertising strategies
Was this page helpful?