Ads
The
google_ads
source is optimized to retrieve Google Search results page (SERP) with paid ads. This source will return only ten results per page, ensuring the highest chances of paid results showing up. Other than that, it supports the same parameters as regular Search.Parameter | Description | Default Value |
---|---|---|
source | google_ads | |
domain | com | |
query | UTF-encoded keyword | - |
start_page | Starting page number | 1 |
pages | Number of pages to retrieve | 1 |
locale | Accept-Language header value which changes your Google search page web interface language. More info. | - |
geo_location | The geographical location that the result should be adapted for. Using this parameter correctly is extremely important to get the right data. For more information, read about our suggested geo_location parameter structures here. | - |
user_agent_type | desktop | |
render | - | |
callback_url | - | |
parse | true will return structured data. | - |
context :
nfpr | true will turn off spelling auto-correction. | false |
context :
results_language | - | |
context :
tbm | To-be-matched or tbm parameter. Accepted values are: app , blg , bks , dsc , isch , nws , pts , plcs , rcp , lcl | - |
context :
tbs | tbs parameter. This parameter is like a container for more obscure google parameters, like limiting/sorting results by date as well as other filters, some of which depend on the tbm parameter (e.g. tbs=app_os:1 is only available with tbm value app ). More info here. | - |
- required parameter
In this example, we make a request to
google.nl
to retrieve search results for the keyword adidas.
JSON
cURL
Python
PHP
HTTP
{
"source": "google_ads",
"domain": "nl",
"query": "adidas",
"parse": true
}
curl --user "user:pass1" 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json" -d '{
"source": "google_ads",
"domain": "nl",
"query": "adidas",
"parse": true
}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_ads',
'domain': 'nl',
'query': 'adidas'
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
<?php
$params = [
'source' => 'google_ads',
'domain' => 'nl',
'query' => 'adidas'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1");
$headers = [];
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
https://realtime.oxylabs.io/v1/queries?source=google_ads&domain=nl&query=adidas
The example above uses the Realtime integration method. If you would like to use some other integration method in your query (e.g. Push-Pull or Proxy Endpoint), refer to the integration methods section.
Last modified 3mo ago