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,也熟悉網路程式設計概念和網路資料格式。如果您尚未使用 Display & Video 360,請先試用網頁 UI,再開始撰寫程式碼。
選擇專案
您必須在 Google API 控制台中建立或選取專案,並啟用 API。
您可以建立新專案,或使用現有專案。
建立新專案
請按照 Google API 控制台中的步驟建立專案,並自動啟用 Display & Video 360 API。
使用現有專案
以下說明如何為現有專案手動啟用 Display & Video 360 API。
如果想為專案啟用 API,請按照以下步驟操作:
- 在 Google API 控制台中開啟 API 程式庫。按照系統說明選取專案,或建立新專案。API 程式庫會列出所有可用的 API,並按照產品系列及熱門程度分組。
- 如果清單裡找不到您想啟用的 API,請使用搜尋功能。
- 選取要啟用的 API,然後按一下「啟用」按鈕。
- 如果系統顯示提示,請啟用帳單功能。
- 如果系統顯示提示,請接受 API 的服務條款。
產生憑證
您向 Display & Video 360 API 提出的所有要求都必須獲得授權。如要簡要瞭解授權,請參閱如何向 Google 授權並識別應用程式。
請按照下列操作說明,建立 OAuth 2.0 用戶端 ID,以便與已安裝的應用程式流程搭配使用。如要瞭解如何產生憑證,以便搭配服務帳戶流程使用,請參閱服務帳戶指南。
按照步驟設定 Google API 控制台專案。
- 在 API 控制台中開啟「憑證」頁面。
依序點選 [Create credentials] (建立憑證) > [OAuth client ID] (OAuth 用戶端 ID)。
系統提示時,請選取最適用的應用程式類型。這些指南提供的 Java 和 Python 程式碼片段假設為電腦應用程式,而 PHP 程式碼片段則假設為網頁應用程式。
輸入其他必要資訊。
- 如果這是您第一次建立用戶端 ID,除了可以選取應用程式類型,您還可以按一下「設定同意畫面」按鈕來設定同意畫面。第一次設定後,系統就不會再提示您設定同意聲明畫面,但您隨時可以更新這項資訊。
按一下「建立」。
完成後,系統會顯示 OAuth 2.0 用戶端 ID 和用戶端密碼,您可以以 JSON 格式下載並儲存,以供日後使用。
如果使用 OAuth 2.0 進行驗證,使用者只要接受同意畫面中顯示的條款,即可完成驗證。
如想設定專案的同意畫面,請按照以下步驟操作:
- 在 Google API 控制台中開啟同意畫面頁面。
按照系統說明選取專案,或建立新專案。
- 填寫表單,然後按一下「儲存」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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**."]]