以下概述我们通过 Google 支持的 所有可用数据
source
值 。来源 | 描述 | 结构化数据 |
---|---|---|
google | 提交您喜欢的任意 Google 网址。 | 取决于 URL。 |
google_search | SERP。 | 是。 |
google_ads | SERP,针对最大广告率进行优化。 仅 num=10 。 | 是。 |
google_hotels | 传奇酒店的服务。 | 是。 |
google_travel_hotels | 旅行:酒店服务。 | 是。 |
google_images | 反向图像搜索。 | 是。 |
google_suggest | 自动完成的搜索词建议。 | 是。 |
google_msv_v2 | 每月搜寻流量。 | 是。 |
google_trends_explore | 趋势。 | 是。 |
您可以通过选择菜单右侧的名称跳转至您喜欢的 Google 页面类型。每个页面都包含参数表以及代码示例,可帮助您开始查询。
google
源设计用于检索各种 Google URL 中的内容。这意味着,您可以向我们提供一个转至所需 Google 页面的直接 URL,而不是发送多个参数。我们不会剥离任何参数或以任何其他方式更改您的 URL。这个数据源也支持解析数据(JSON 格式的结构化数据),只要提交的 URL 用于 Google(SERP 页面)。如果我们不能确认这是一个 SERP 页面请求,我们将返回一个故障信息。
- 必须提供的参数
在以下示例中,API 将检索一个 Google Scholar 搜索页面。
JSON
cURL
Python
PHP
HTTP
{
"source": "google",
"url": "https://scholar.google.com/scholar?hl=en&q=newton&btnG=&as_sdt=1%2C5&as_sdtp="
}
curl --user user:pass1 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json"
-d '{"source": "google", "url": "https://scholar.google.com/scholar?hl=en&q=newton&btnG=&as_sdt=1%2C5&as_sdtp="}{"source": "google", "url": "https://scholar.google.com/scholar?hl=en&q=newton&btnG=&as_sdt=1%2C5&as_sdtp="}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google',
'url': 'https://scholar.google.com/scholar?hl=en&q=newton&btnG=&as_sdt=1%2C5&as_sdtp='
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Instead of response with job status and results url, this will return the
# JSON response with results.
pprint(response.json())yhon
<?php
$params = array(
'source' => 'google',
'url' => 'https://scholar.google.com/scholar?hl=en&q=newton&btnG=&as_sdt=1%2C5&as_sdtp='
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://data.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 = array();
$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);
?>
# URL has to be encoded to escape `&` and `=` characters:
# URL: https://scholar.google.com/scholar?hl=en&q=newton&btnG=&as_sdt=1%2C5&as_sdtp=
# Encoded URL: https%3A%2F%2Fscholar.google.com%2Fscholar%3Fhl%3Den%26q%3Dnewton%26btnG%3D%26as_sdt%3D1%252C5%26as_sdtp%3D
https://realtime.oxylabs.io/v1/queries?source=google&url=https%3A%2F%2Fscholar.google.com%2Fscholar%3Fhl%3Den%26q%3Dnewton%26btnG%3D%26as_sdt%3D1%252C5%26as_sdtp%3D&access_token=12345abcde
google_search
源设计用于检索 Google Search 结果(SERP)。参数 | 描述 | 默认值 |
---|---|---|
source | google_search | |
domain | 域本地化 | com |
query | UTF 编码的关键字 | - |
start_page | 起始页数 | 1 |
pages | 检索的页数 | 1 |
limit | 每页中要检索的结果数 | 10 |
locale | - | |
geo_location | - | |
user_agent_type | desktop | |
render | | |
callback_url | - | |
parse | - | |
context :
fpstate | 设置 fpstate 值为 aig 将使 Google 加载更多应用程序。这个参数只有在与渲染 参数一起使用时才有用。 | - |
context :
nfpr | true 将关闭拼写自动纠正功能。 | false |
context :limit_per_page | 如果要使用相同的IP地址抓取多个页面,请包含一个JSON数组,并使用 page 键指定页面数量。还必须通过添加 limit 键来指示每个页面上的自动搜索结果数,例如:"context": [{ "key": "limit_per_page", "value": [ {"page": 1, "limit": 10}, {"page": 2, "limit": 90} ] }] | - |
context :
results_language | - | |
context :
tbm | 待配或 tbm 参数。可接受的值是:app 、blg 、bks 、dsc 、isch 、nws 、pts 、plcs 、rcp 、lcl 。 | - |
context :
tbs | ttbs 参数这个参数就像一个容器,用于存放更多无名 Google 参数,比如按日期限制/排序结果,以及其他过滤器,其中一些取决于 tbm 参数(例如 tbs=app_os:1 只适用于 tbm 值 app ).单击此处了解更多相关信息。 | - |
- 必须提供的参数
在以下示例中,我们请求从
google.nl
域获得 2
个结果页面,从第 11
页到第 12
页,搜索词为 adidas
。SERP 将被过滤,只包含法语的结果。JSON
cURL
Python
PHP
HTTP
{
"source": "google_search",
"domain": "nl",
"query": "adidas",
"start_page": 11,
"pages": 2,
"parse": true,
"context": [
{
"key": "results_language",
"value": "fr"
}]
}
curl --user user:pass1 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json"
-d '{"source": "google_search", "domain": "nl", "query": "adidas", "start_page": 11, "pages": 2, "parse": true, "context": [{"key": "results_language", "value": "fr"}]}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_search',
'domain': 'nl',
'query': 'adidas',
'start_page': 11,
'pages': 2,
'context': [
{'key': 'results_language', 'value': 'fr'},
],
}
# 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 = array(
'source' => 'google_search',
'domain' => 'nl',
'query' => 'adidas',
'start_page' => 11,
'pages' => 2,
'context' => array(
'key' => 'results_language',
'value' => 'fr'
)
);
$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 = array();
$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);
?>hp
https://realtime.oxylabs.io/v1/queries?source=google_search&domain=nl&query=adidas&start_page=11&pages=2&context[0][key]=results_language&context[0][value]=fr&access_token=12345abcde
参数 | 描述 | 默认值 |
---|---|---|
source | google_ads | |
domain | Google 的域名本地化。单击此处查看可用域名的完整列表。 | com |
query | UTF 编码的关键字 | - |
start_page | 起始页数 | 1 |
pages | 检索的页数 | 1 |
locale | - | |
geo_location | - | |
user_agent_type | desktop | |
render | - | |
callback_url | - | |
parse | - | |
context :
nfpr | true 将关闭拼写自动纠正功能。 | false |
context :
results_language | - | |
context :
tbm | 待配或 tbm 参数。可接受的值是:app 、blg 、bks 、dsc 、isch 、nws 、pts 、plcs 、rcp 、lcl 。 | - |
context :
tbs | tbs 参数这个参数就像一个容器,用于存放更多无名 google 参数,比如按日期限制/排序结果以及其他过滤器,其中一些取决于tbm 参数(例如 tbs=app_os:1 只适用于 tbm 值 app ).单击此处了解更多相关信息。 | - |
- 必须提供的参数
在这个示例中,我们向
google.nl
发送请求检索关键字 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 pprinthp
# 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 = array(
'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 = array();
$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
google_hotels
数据源设计用于检索 Google Hotel 搜索结果。参数 | 描述 | 默认值 |
---|---|---|
source | google_hotels | |
domain | 域本地化 | com |
query | UTF 编码的关键字 | - |
start_page | 起始页数。 | 1 |
pages | 检索的页数。 | 1 |
limit | 每页中要检索的结果数。 | 10 |
locale | - | |
results_language | - | |
geo_location | - | |
user_agent_type | desktop | |
render | | |
callback_url | - | |
context :
nfpr | true 将关闭拼写自动纠正功能。 | false |
context :
hotel_occupancy | 宾客人数。 | 2 |
context :
hotel_dates | 入住酒店时长,入住日期 - 离开日期。示例: 2023-07-12,2023-07-13 。 | - |
- 必须提供的参数
注意:使用 Google hotel,您始终需要发送一个包含“酒店”一词的关键词 例如,“洛杉矶的酒店”,“法国巴黎的酒店”,等等。“宾馆”和“酒店”都可以。Google 还支持当地语言,为赫尔辛基的酒店发送“Hotelli Helsingissä”,为维尔纽斯的酒店发送“viešbučiai Vilnius”。
在这个示例中,我们请求
从
google.com.sons. 检索前
3 页页面,以查询
2023-10-01 至
2023-10-10期间在巴黎是否
有可容纳1
名客人的酒店。JSON
cURL
Python
PHP
HTTP
{
"source": "google_hotels",
"domain": "com",
"pages": 3,
"query": "hotels in Paris",
"context": [
{
"key": "hotel_occupancy",
"value": 1
},
{
"key": "hotel_dates",
"value": "2023-10-01,2023-10-10"
}]
}
curl --user user:pass1 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json"
-d '{"source": "google_hotels", "domain": "com", "pages": 3, "query": "hotels in Paris", "context": [{"key": "hotel_occupancy", "value": 1}, {"key": "hotel_dates", "value": "2023-10-01,2023-10-10"}]}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_hotels',
'domain': 'com',
'query': 'hotels in Paris',
'pages': 3,
'context': [
{'key': 'hotel_occupancy', 'value': 1},
{'key': 'hotel_dates', 'value': '2023-10-01,2023-10-10'},
],
}
# 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 = array(
'source' => 'google_hotels',
'domain' => 'com',
'query' => 'hotels in Paris',
'pages' => 3,
'context' => [
[
'key' => 'hotel_occupancy',
'value' => 1,
],
[
'key' => 'hotel_dates',
'value': '2023-10-01,2023-10-10',
]
]
);
$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 = array();
$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_hotels&domain=com&query=hotels+in+Paris&pages=3&context[0][key]=hotel_occupancy&context[0][value]=1&context[1][key]=hotel_dates&context[1][value]=2023-10-01,2023-10-10&access_token=12345abcde
Google_travel_hotels
数据源设计用于检索 Google Travel 服务的酒店搜索结果。google_travel_hotels-bad_geo_locations.csv
24KB
Text
参数 | 描述 | 默认值 |
---|---|---|
source | google_travel_hotels | |
domain | 域本地化 | com |
query | UTF 编码的关键字 | - |
start_page | 起始页数 | 1 |
locale | - | |
geo_location | 结果应适应的地理位置。正确使用这个参数对获得正确数据极为重要。请注意,这个来源可以接受数量有限的 geo_location 值 - 请检查 本节 来查看不 产生准确结果的geo_location 值。 | - |
user_agent_type | desktop | |
render | - | |
callback_url | - | |
context :
hotel_occupancy | 宾客人数 | 2 |
context :
hotel_classes | 按酒店星级过滤结果。您可 以指定一个或多个介于 2 和 5 之间的值.例如:[3,4] | - |
context :
hotel_dates | 住在酒店的日期,入住日期 - 离开日期。示例: 2023-07-12,2023-07-13 | - |
- 必须提供的参数
注意:请注意,使用 Google Hotels,您的关键词必须始终包括“酒店”,例如,“洛杉矶的酒店”、“法国巴黎的酒店”等。“宾馆”和“酒店”都可以。Google 还支持当地语言,为赫尔辛基的酒店发送“Hotelli Helsingissä”,为维尔纽斯的酒店发送“viešbučiai Vilnius”。
在这个示例中,我们请求从 google.com 检索第
2
页结果页面,以查询 2023-10-01
至 2023-10-10
期间在巴黎是否有可容纳2
名客人的2
至 4
-星级酒店。JSON
cURL
Python
PHP
HTTP
{
"source": "google_travel_hotels",
"domain": "com",
"start_page": 2,
"query": "hotels in Paris",
"context": [
{
"key": "hotel_occupancy",
"value": 2
},
{
"key": "hotel_dates",
"value": "2023-10-01,2023-10-10"
},
{
"key": "hotel_classes",
"value": [2,4]
}]
}
curl --user user:pass1 'https://realtime.oxylabs.io/v1/queries' -H "Content-Type: application/json"
-d '{"source": "google_travel_hotels", "domain": "com", "start_page": 2, "query": "hotels in Paris", "context": [{"key": "hotel_occupancy", "value": 2}, {"key": "hotel_dates", "value": "2023-10-01,2023-10-10"}, {"key": "hotel_classes", "value": [2,4]}]}'
ythimport requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_travel_hotels',
'domain': 'com',
'query': 'hotels in Paris',
'start_page': 2,
'context': [
{'key': 'hotel_occupancy', 'value': 1},
{'key': 'hotel_dates', 'value': '2023-10-01,2023-10-10'},
{'key': 'hotel_classes', 'value': [2,4]},
],
}
# 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 = array(
'source' => 'google_travel_hotels',
'domain' => 'com',