有兴趣分享您对 Google Ads API 的反馈吗?
注册即可获邀参与用户调研!
设置 Google API 控制台项目
您需要一个 Google API 控制台项目来创建 OAuth 2.0 凭据,并为您的应用启用 Google Ads API。
这些凭据是 Google 服务器对 Google Ads 用户进行身份验证和授权所必需的。借助这些凭据,您可以生成要在调用 API 时使用的 OAuth 令牌。
虽然您可以将一个开发者令牌用于多个项目,但每个项目只能使用一个开发者令牌。
选择或创建 Google API 控制台项目
如果您已经有一个 Google API 控制台项目,并且想要使用该项目创建凭据,可以跳至在项目中启用 Google Ads API。
按照说明创建项目。为您的项目启用结算功能并非强制性要求。如果您已启用结算功能,请为新项目选择一个结算账号。使用 Google Ads API 无需支付任何费用,不过,会对 Google Cloud 项目的总数有配额限制。
在项目中启用 Google Ads API
如需在项目中启用 Google Ads API,请按以下步骤操作:
在 Google API 控制台中打开 API 库。如果系统提示,请选择您的项目或创建一个新项目。API 库中列出了所有可用的 API(按产品系列和热门程度分组)。
如果列表中没有显示 Google Ads API,请使用搜索功能找到该 API。
选择 Google Ads API,然后点击启用按钮。
启用 Google Ads API
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-12。
[null,null,["最后更新时间 (UTC):2025-02-12。"],[[["Before making API calls, you must create an OAuth 2.0 client ID and client secret within a Google API Console project and note their values."],["You need to configure an OAuth consent screen to define what users see regarding your project's access and data usage."],["To use the Google Ads API, you must enable it within your Google API Console project using the API Library."],["Creating a client ID and client secret requires selecting an application type (Desktop app or Web application) and saving the generated credentials."]]],[]]