Search Analytics
方法
- query
使用您定义的过滤器和参数查询搜索流量数据。该方法会返回按您定义的行键(维度)分组的零行或零个以上行。您必须将日期范围定义为一天或多天。
如果日期是维度之一,则结果列表中会忽略所有没有数据的日期。如需了解哪些日期有数据,请针对相关日期范围发出不含按日期分组的过滤条件的查询。
结果按点击次数降序排序。如果两行的点击计数相同,则会以任意方式对其进行排序。
如需了解如何调用此方法,请参阅 python 示例。
该 API 受 Search Console 内部限制的约束,并不保证会返回所有
而是最靠前的行。
查看可用数据量的限制。
JSON POST 示例:
POST https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.example.com%2F/searchAnalytics/query?key={MY_API_KEY}
{
"startDate": "2015-04-01",
"endDate": "2015-05-01",
"dimensions": ["country","device"]
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-29。
[null,null,["最后更新时间 (UTC):2024-08-29。"],[[["The Search Analytics API allows you to query your website's search traffic data with custom filters and parameters, returning results grouped by specified dimensions."],["You can define date ranges for your queries, but the API might not return all data rows due to internal limitations, prioritizing top results instead."],["Results are sorted by click count in descending order, with arbitrary sorting for rows with identical click counts, and days without data are omitted from the result list."],["When querying with \"date\" as a dimension, you can identify days with data by performing a filter-less query grouped by date for the desired date range."],["The API offers a \"query\" method to retrieve search traffic data and provides a Python sample for utilizing this method."]]],[]]