Google 的 API 平台为使用该平台构建的所有 Google API 提供了一组通用功能。为了使用和控制这组功能,该平台预先设置了一组特殊的请求参数(名为“系统参数”)。这些参数在所有 Google REST API 和 gRPC API 中提供。您可以使用 HTTP 查询参数或 HTTP 标头指定一个系统参数。对于 Google gRPC API,仅支持使用 HTTP 标头。
大多数用户不需要直接使用这些参数。但是,Google 提供的客户端库经常会使用它们。如果您需要编写自定义代码以直接访问 Google API,则系统参数会在控制 JSON 整齐打印或指定 API 密钥等情况下非常有用。
Google API 密钥。如需了解详情,请参阅 https://cloud.google.com/docs/authentication/api-keys。
passwd, password
预留以防止将密码放入网址中。
$prettyPrint, prettyPrint
整齐打印 JSON 响应。支持的值为 true(默认)、false。
quotaUser
X-Goog-Quota-User
用于按用户配额收费的伪用户标识符。如果未指定,则使用经过身份验证的主账号。如果没有经过身份验证的主账号,将使用客户端 IP 地址。指定此标志时,必须使用具有服务限制的有效 API 密钥来标识配额项目。否则,此参数会被忽略。
$outputDefaults
强制输出 JSON 响应的原始默认值。
$unique
用于停用请求缓存的唯一查询参数。
X-Goog-Api-Client
API 客户端标识。该值是以空格分隔的 NAME "/" SEMVER 字符串列表,其中 NAME 只能包含小写字母、数字和“-”,并且 SEMVER 应为语义版本字符串。例如:X-Goog-Api-Client: python/3.5.0 grpc-google-pubsub-v1/0.1.0-beta2 linux/2.7.0。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eGoogle's API platform utilizes system parameters to manage common functionalities across all Google REST and gRPC APIs, which can be specified via HTTP query parameters or headers.\u003c/p\u003e\n"],["\u003cp\u003eWhile most users won't interact with system parameters directly, they are commonly used by Google-provided client libraries and can be useful for custom code in scenarios like JSON formatting or API key specification.\u003c/p\u003e\n"],["\u003cp\u003eSystem parameters in HTTP requests are sent as URL query parameters or headers, denoted by a \u003ccode\u003e$\u003c/code\u003e prefix to avoid conflicts with regular parameters.\u003c/p\u003e\n"],["\u003cp\u003eFor gRPC requests, system parameters are sent as HTTP request headers with lowercase keys, in contrast to the query parameters for HTTP requests.\u003c/p\u003e\n"],["\u003cp\u003eA variety of system parameters exist, such as \u003ccode\u003e$alt\u003c/code\u003e for alternative response formats, \u003ccode\u003e$key\u003c/code\u003e for API keys, \u003ccode\u003equotaUser\u003c/code\u003e for user-specific quotas, and \u003ccode\u003eX-Server-Timeout\u003c/code\u003e for request timeouts.\u003c/p\u003e\n"]]],[],null,["# System parameters\n\nGoogle's API platform provides a set of common functionality to all Google APIs\nbuilt using the platform. In order to use and control such functionality,\nthe platform pre-defines a special set of request parameters called\n*system parameters*. These parameters are available across all Google REST APIs\nand gRPC APIs. A system parameter can be specified either using an HTTP query\nparameter or an HTTP header. For Google gRPC APIs, only HTTP headers are\nsupported.\n\nMost users will not need to use these parameters directly. However, they are\noften used by Google-provided\n[client libraries](/apis/docs/client-libraries-explained). If you need to write\ncustom code to access Google APIs directly, the system parameters can be\nuseful in cases such as controlling JSON pretty-printing or specifying API Keys.\n\nHTTP Mapping\n------------\n\nFor HTTP requests, system parameters are sent as URL query parameters or\nHTTP request headers. For example, if you have a system parameter `$foo`, it's\nsent as `?$foo=xxx` in the URL, or `?%24foo=xxx` if URL-encoded. See the\ntable below for details.\n| **Note:** The `$` name prefix is added to avoid conflicting with normal request parameters.\n\ngRPC Mapping\n------------\n\nFor [gRPC](https://grpc.io/) requests, system parameters are sent as HTTP\nrequest headers with keys in lowercase. See the table below for details.\n\nDefinitions\n-----------\n\nThe following table lists all system parameters and their definitions.\n\nChangelog\n---------\n\n- 2021-11 Published documentation for `x-goog-request-params`.\n- 2021-02 Published documentation for `quotaUser`.\n- 2020-07 Deprecated OAuth 2.0 query parameters.\n- 2019-10 Introduced `X-Server-Timeout` system parameter.\n- 2017-10 Introduced `X-Goog-User-Project` system parameter."]]