Starting
September 8, 2025, every new line item will need to declare whether or not they will serve Eurpoean Union (EU) political ads. Display & Video 360 API and SDF uploads that don't provide declarations will fail. See our
deprecations page for more details on how to update your integration to make this declaration.
开始使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Display & Video 360 API 是 Display & Video 360 平台的程序化接口。您可以使用 Display & Video 360 API 自动执行复杂的 Display & Video 360 工作流程。以下是您可以使用 Display & Video 360 API 执行的一些任务示例:
本指南介绍了如何开始使用 Display & Video 360 API。
前提条件
在使用 Display & Video 360 API 之前,您必须执行以下操作:
您必须拥有 Google 账号。您需要拥有一个 Google 账号才能在 Google API 控制台中创建项目。如果您已经拥有账号,则无需进行任何操作。您可能还需要一个用来测试的单独 Google 账号。
您必须有权访问 Display & Video 360。您需要有权访问 Display & Video 360 产品,才能使用此 API。如果贵组织已签订 Display & Video 360 合约,请确保已为您的 Google 账号创建具有适当权限的用户个人资料。如果没有,请与我们的销售团队联系,了解详情。
您应该试用 Display & Video 360。本 API 文档假定您已使用 Display & Video 360,并且熟悉 Web 编程概念和 Web 数据格式。如果您尚未使用过 Display & Video 360,请在开始编码前,试用和熟悉一下网站界面。
选择项目
您需要在 Google API 控制台中创建或选择一个项目,并启用该 API。
您可以创建新项目,也可以使用现有项目。
创建新项目
按照 Google API 控制台中的步骤创建项目,并自动启用 Display & Video 360 API。
使用现有项目
下面介绍了如何手动为现有项目启用 Display & Video 360 API。
如需为您的项目启用 API,请执行以下操作:
- 在 Google API 控制台中打开 API 库。如果系统提示,请选择一个项目或创建一个新项目。API 库中列出了所有可用的 API(按产品系列和热门程度分组)。
- 如果列表中没有显示您要启用的 API,请使用搜索功能查找该 API。
- 选择您要启用的 API,然后点击启用按钮。
- 如果系统提示,请启用结算功能。
- 如果系统提示,请接受该 API 的服务条款。
生成凭据
向 Display & Video 360 API 发出的所有请求都必须获得授权。如需简要了解授权,请参阅如何进行授权和让 Google 识别您的应用。
以下说明将引导您完成创建 OAuth 2.0 客户端 ID(以便在“已安装的应用”流程中使用)的整个过程。如需生成用于在“服务账号”流程中访问 API 的凭据,请参阅服务账号指南。
按照相应步骤配置一个 Google API 控制台项目。
- 打开 API 控制台中的“凭据”页面。
点击创建凭据 > OAuth 客户端 ID。
当系统提示时,选择最适合的应用类型。这些指南中提供的 Java 和 Python 代码段假定为桌面应用,而 PHP 代码段假定为网站应用。
输入任何其他必要信息。
- 如果这是您首次创建客户端 ID,除了可以选择应用类型之外,还可以通过点击配置同意屏幕按钮来配置您的同意屏幕。在您首次配置同意屏幕后,系统就不会再提示您配置该屏幕了,不过您可以随时对所配置的这些信息进行更新。
点击创建。
完成后,系统会显示一个 OAuth 2.0 客户端 ID 和客户端密钥,您可以将其下载为 JSON 格式进行保存,以备日后使用。
当您使用 OAuth 2.0 进行身份验证时,您的用户需要先接受用户同意屏幕上显示的条款,才能完成身份验证。
如需设置项目的权限请求页面,请执行以下操作:
- 在 Google API 控制台中打开“同意屏幕”页面。
如果系统提示,请选择一个项目或创建一个新项目。
- 填写表单并点击保存。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Display & Video 360 API allows programmatic access to automate complex workflows within the Display & Video 360 platform, including tasks like creative management, line item targeting, and structured data file generation.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, ensure you have a Google Account, access to Display & Video 360, and familiarize yourself with the platform's web UI.\u003c/p\u003e\n"],["\u003cp\u003eYou need to create or select a Google API Console project and enable the Display & Video 360 API to start using it.\u003c/p\u003e\n"],["\u003cp\u003eGenerate OAuth 2.0 credentials for authorization, following the guide for either installed application or service account flow depending on your needs.\u003c/p\u003e\n"],["\u003cp\u003eConfigure a user consent screen for your project within the Google API Console to handle user authentication when using OAuth 2.0.\u003c/p\u003e\n"]]],["The Display & Video 360 API automates tasks like uploading creatives, managing line items and targeting, and generating Structured Data Files. To begin, users need a Google Account and Display & Video 360 access, alongside experience with the platform. They must create or select a project in the Google API Console and enable the API. Credentials, specifically an OAuth 2.0 client ID, must be generated, and the user consent screen must be configured to enable application authorization.\n"],null,["The Display \\& Video 360 API is the programmatic interface for the Display \\& Video 360\nplatform. You can use the Display \\& Video 360 API to automate complex\nDisplay \\& Video 360 workflows. Here are some examples of tasks you can do with the\nDisplay \\& Video 360 API:\n\n- [Upload and build\n creatives.](/display-video/api/guides/creating-creatives/overview)\n- [Manage line items and their\n targeting.](/display-video/api/guides/managing-line-items/overview)\n- [Generate and download Structured Data\n Files.](/display-video/api/guides/downloading-sdfs/create)\n\nThis guide describes how to get started with the Display \\& Video 360 API.\n\nPrerequisites\n\nBefore using the Display \\& Video 360 API, you must do the following:\n\n1. **You must have a Google Account.** You need a\n [Google Account](//www.google.com/accounts/NewAccount) in order to [create a project](#create_project)\n in the Google API Console. If you already have an\n account, then you're all set. You may also want a separate Google Account for\n testing purposes.\n\n2. **You must have access to Display \\& Video 360.** You need access to the\n Display \\& Video 360 product in order to work with the API. If your\n organization already has a Display \\& Video 360 contract, ensure a\n [user profile](//support.google.com/displayvideo/answer/2723011) with appropriate permissions has been\n created for your Google Account(s). If not,\n [contact our sales team](//marketingplatform.google.com/about/display-video-360/) for more information.\n\n3. **You should try out Display \\& Video 360.** This API documentation assumes\n that you've used Display \\& Video 360, and that you're familiar with web\n programming concepts and web data formats. If you haven't used\n Display \\& Video 360, then try out the [web UI](https://displayvideo.google.com/) before\n starting to code.\n\nChoose a project\n\nYou need to [create\nor select a project in the Google API Console and enable the API](https://console.cloud.google.com/start/api?id=displayvideo.googleapis.com&credential=client_key).\n\nYou can create a new project, or use an existing one.\n\nCreate a new project\n\nFollow the steps in the [Google API Console](https://console.cloud.google.com/start/api?id=displayvideo.googleapis.com&credential=client_key)\nto create a project and enable the Display \\& Video 360 API automatically.\n\nUse an existing project\n\nHere's how to manually activate the Display \\& Video 360 API for an existing project.\n\nTo enable an API for your project, do the following:\n\n1. [Open the API Library](https://console.cloud.google.com/apis/library) in the Google API Console. If prompted, select a project or create a new one. The API Library lists all available APIs, grouped by product family and popularity.\n2. If the API you want to enable isn't visible in the list, use search to find it.\n3. Select the API you want to enable, then click the **Enable** button.\n4. If prompted, enable billing.\n5. If prompted, accept the API's Terms of Service.\n\nGenerate credentials\n\nAll requests you make to the Display \\& Video 360 API must be authorized. For a brief\noverview of authorization, read about how to [authorize and identify your\napplication to Google](/display-video/api/guides/how-tos/authorizing).\n\nThe following instructions guide you through the process of creating an OAuth\n2.0 client ID to use with the [installed application\nflow](/identity/protocols/OAuth2InstalledApp). For instructions on generating credentials for use\nwith the service account flow, refer to the [Service Accounts](/display-video/api/guides/how-tos/service-account)\nguide.\n\n1. Follow the steps to [configure a Google API Console project](#create_project).\n\n\n2. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) in the API Console.\n3. Click **Create credentials** \\\u003e **OAuth client ID**.\n\n4. Select the most applicable application type when prompted. The Java and\n Python code snippets offered in these guides assume a **Desktop app** , while\n the PHP code snippets assume a **Web application**.\n\n5. Enter any additional required information.\n\n - If this is your first time creating a client ID, besides being able to select your application type, you can configure your consent screen by clicking the **Configure consent screen** button. You won't get a prompt to configure your consent screen again after you do it the first time, although this information can be updated at any time.\n6. Click **Create**.\n\nWhen done, you'll be presented with an OAuth 2.0 client ID and client\nsecret, which you can download in JSON format and save for later use.\n\nConfigure the user consent screen\n\nWhen you use OAuth 2.0 for authentication, your users are authenticated after\nthey agree to terms presented to them on a user consent screen.\n\n\nTo set up your project's consent screen, do the following:\n\n1. Open the [Consent Screen page](https://console.cloud.google.com/apis/credentials/consent) in the Google API Console. If prompted, select a project or create a new one.\n2. Fill out the form and click **Save**."]]