For the complete documentation index, see llms.txt. This page is also available as Markdown.

趋势:探索

按关键词、日期范围和类别提取 Google Trends 数据。API 支持多种搜索类型和筛选。

google_trends_explore 该来源旨在检索 Google Trends 结果。

请求示例

在此示例中,我们发起请求以获取某个搜索词的趋势结果 adidas 在 2021 年 1 月 1 日到 2022 年 2 月 2 日之间,并将类别设置为“艺术与娱乐” (category id: 3).

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "google_trends_explore",
        "query": "adidas",
        "context": [
            {"key": "date_from", "value": "2021-01-01"},
            {"key": "date_to", "value": "2022-02-02"},
            {"key": "category_id", "value": 3}
        ]
    }'

我们的示例使用同步 Realtime 集成方式。如果你想使用 Proxy Endpoint 或异步 Push-Pull 集成,请参阅 集成方式 部分。

请求参数值

通用

用于抓取 Google Trends 结果的基础设置和自定义选项。

参数
描述
默认值

source

设置抓取器。

google_trends_explore

query

要搜索的关键词或短语。

-

callback_url

回调端点的 URL。 更多信息

-

user_agent_type

设备类型和浏览器。完整列表可在 此处.

desktop

geo_location

结果应适配的地理位置。对于 Google Trends: Explore,我们接受 2 位字母的 ISO 国家代码作为 geo_location 参数值。

-

- 必填参数

过滤

用于定制和细化搜索上下文的高级选项。

参数
描述
默认值

context:

search_type

允许你设置搜索类型(Google Trends 界面中的选项之一)。可选值: web_search, image_search, google_shopping, youtube_search.

web_search

context:

date_from

下限日期范围。格式: YYYY-MM-DD. 最早可用日期: 2004-01-01.

-

context:

date_to

上限日期范围。格式: YYYY-MM-DD. 最早可用日期: 2004-01-01.

-

context:

category_id

类别 ID。请参阅 此文件 中的有效值列表。

-

上下文参数

所有上下文参数都应作为对象添加到 context 数组中,包含 keyvalue 键值对,例如:

注意:该服务始终提供结构化数据,因此无需对该来源使用 parse 参数。

输出示例

最后更新于

这有帮助吗?