rocket
隆重推出
Merchant API - Content API for Shopping 的正式替代方案。
update
获取最新资讯,了解 Merchant API 的新功能、问题修复和更新。
add_alert
注意:Content API for Shopping 将于 2026 年 8 月 18 日停用。
日期范围
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Merchant Center 查询语言,您可以使用自定义日期范围或相对日期范围指定日期范围。所有指标请求都必须在 WHERE
子句中包含 segments.date
的条件,以指明您要检索效果数据的时间段。
自定义日期范围
您可以使用 ISO 8601(YYYY-MM-DD) 格式指定日期:
segments.date BETWEEN '2021-01-01' AND '2021-01-31'
或者:
segments.date >= '2021-01-01' AND segments.date <= '2021-01-31'
您可以使用英文单引号 ('
) 或英文双引号 ("
) 定义日期字符串。不过,您必须保持一致;例如,"2021-01-01'
不是有效的日期字符串。
相对日期范围
除了自定义日期范围之外,您还可以使用 DURING
(而非 BETWEEN
和 AND
)指定相对日期范围,例如 LAST_30_DAYS
或 THIS_MONTH
:
WHERE segments.date DURING LAST_30_DAYS
如需查看可用的相对日期范围列表,请参阅 Merchant Center 查询语言语法。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-13。
[null,null,["最后更新时间 (UTC):2025-08-13。"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of the platform.\u003c/p\u003e\n"],["\u003cp\u003eAll Merchant Center Query Language requests for metrics require a \u003ccode\u003esegments.date\u003c/code\u003e condition in the \u003ccode\u003eWHERE\u003c/code\u003e clause to specify the desired time period for performance data retrieval.\u003c/p\u003e\n"],["\u003cp\u003eDate ranges can be specified using custom ISO 8601 formatted dates or relative date ranges like \u003ccode\u003eLAST_30_DAYS\u003c/code\u003e using \u003ccode\u003eDURING\u003c/code\u003e in the \u003ccode\u003eWHERE\u003c/code\u003e clause.\u003c/p\u003e\n"]]],["The beta version of the Merchant API, the new Content API for Shopping, is introduced. All requests for performance metrics require a `segments.date` condition in the `WHERE` clause. Dates can be specified in ISO 8601 format within a custom range using `BETWEEN` or `\u003e=` and `\u003c=`. Alternatively, relative date ranges like `LAST_30_DAYS` can be specified with `DURING`. For a list of available date ranges, the grammar documentation should be consulted.\n"],null,["# Date ranges\n\nThe Merchant Center Query Language lets you specify a date range using a custom\nor relative date range. **All requests for metrics must include a condition for\n`segments.date` in the`WHERE` clause** to indicate the time period from which\nyou want to retrieve your performance data.\n\nCustom date range\n-----------------\n\nYou can specify dates in ISO 8601(YYYY-MM-DD) format: \n\n segments.date BETWEEN '2021-01-01' AND '2021-01-31'\n\nOR: \n\n segments.date \u003e= '2021-01-01' AND segments.date \u003c= '2021-01-31'\n\nYou can define date strings with either single quotes (`'`) or double quotes\n(`\"`). However, you must be consistent; for example: `\"2021-01-01'` is not a\nvalid date string.\n\nRelative date range\n-------------------\n\nIn addition to custom date ranges, you can specify a relative date range such\nas `LAST_30_DAYS` or `THIS_MONTH` by using `DURING` instead of `BETWEEN` and\n`AND`: \n\n WHERE segments.date DURING LAST_30_DAYS\n\nCheck out the\n[Merchant Center Query Language grammar](/shopping-content/guides/reports/query-language/grammar)\nfor the list of available relative date ranges."]]