本页面包含有关 VersionHistory Web Service API 的技术参考信息。
所有 API 访问都通过 HTTPS 进行,并且可从 https://versionhistory.googleapis.com/v1
访问。
版本
版本是指用户正在运行的特定 Chrome 实例。
获取指定平台和渠道的版本信息
列出指定平台和渠道的所有 Chrome 版本。
GET /{product}/platforms/{platform}/channels/{channel}/versions
名称 | 说明 |
---|---|
product |
商品标识码。 |
platform |
平台标识符。 |
channel |
渠道标识符。 |
版本
版本是指用户运行特定 Chrome 版本的时间间隔。发布端点还会提供在该时间间隔内运行相应 Chrome 版本的用户所占的比例。
获取所有版本
列出指定平台、渠道和版本的所有版本。
GET /{product}/platforms/{platform}/channels/{channel}/versions/{version}/releases
名称 | 说明 |
---|---|
product |
商品标识码。 |
platform |
平台标识符。 |
channel |
渠道标识符。 |
version |
版本标识符。 |
产品
产品是指 Chrome 或 Fuchsia Web Engine 等软件。
商品标识码
说明 | 值 |
---|---|
Chrome | chrome |
Fuchsia Web 引擎 | fuchsiawebengine |
平台
平台是运行产品的一种计算平台,例如 Windows、Android 等。
获取所有平台
GET /{product}/platforms
名称 | 说明 |
---|---|
product |
商品标识码。 |
获取所有平台和渠道组合
GET /{product}/platforms/all/channels
名称 | 说明 |
---|---|
product |
商品标识码。 |
平台标识符
说明 | 值 |
---|---|
所有平台 | all |
Windows | win |
Windows(64 位) | win64 |
Mac | mac |
Mac (ARM64) | mac_arm64 |
Linux | linux |
Android | android |
WebView | webview |
iOS | ios |
拉克罗斯 | lacros |
频道
请参阅如何选择要使用的渠道?,了解 Chrome 渠道的说明。
获取平台的有效渠道
列出指定平台的有效频道:
GET /{product}/platforms/{platform}/channels
名称 | 说明 |
---|---|
product |
商品标识码。 |
platform |
平台标识符。 |
渠道标识符
VersionHistory API 支持以下渠道标识符:
说明 | 值 |
---|---|
扩展稳定版 | extended |
稳定 | stable |
Beta 版 | beta |
开发版 | dev |
Canary 版 | canary |
Canary(变体 build) | canary_asan |
过滤结果
添加一个 filter
查询参数以过滤结果。只有版本端点和发布端点支持过滤。例如:
GET /chrome/platforms/win/channels/stable/versions/all/releases?filter=fraction=1
filter
的值应该是以英文逗号分隔的表达式列表。每个表达式都应采用 field operator value
形式。
商品 | 有效值 |
---|---|
字段 |
version 、name 、platform 、starttime *、endtime *、fraction *
|
运营商 |
< 、<= 、= 、> 、>=
|
- 通道过滤根据与稳定版的距离完成,也就是说,
stable
<beta
<dev
<canary
<canary_asan
。例如,channel<=dev
会返回stable
、beta
和dev
的信息。 - 版本过滤以数字方式完成,例如
1.0.0.8
<1.0.0.10
。如果某个版本并非完全写入,VersionHistory 会为缺少的字段附加0
。例如,version>80
会变为version>80.0.0.0
。 endtime=none
可过滤出当前有效且尚未设置结束时间的版本。- 按
starttime
或endtime
过滤时,值必须采用 RFC 3339 日期字符串格式。 - 系统会通过字符串比较来过滤
name
和platform
。 - 对于 Chrome 仍在提供的版本,将不会填充
serving.endtime
。 在排序或过滤期间,如果未填充该字段,serving.endtime
将被视为1970-01-01T00:00:00Z
。 fraction
用于指定发布涉及的用户数。例如,fraction=1
表示所有用户。
订单结果
为排序结果添加 order_by
查询参数。只有版本和发布端点支持排序。例如:
GET /chrome/platforms/win/channels/stable/versions/all/releases?order_by=starttime
order_by
接受以逗号分隔的以下值列表:version
、name
、platform
、channel
、starttime
、endtime
、fraction
。
在 order_by
值后面添加一个空格字符 (%20
),后跟 asc
或 desc
,以指定升序或降序。例如:
GET /chrome/platforms/win/channels/stable/versions/all/releases?order_by=starttime%20asc
- 频道排序按以下顺序完成:
stable
、beta
、dev
、canary
、canary_asan
。 - 按
name
排序可能会导致意外行为,因为它是一种简单的字符串排序。例如,1.0.0.8
会排在 1.0.0.10 之前(按降序排列)。 - 未指定
order_by
时,默认排序顺序为:platform
、channel
、version
、serving.starttime
。