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.
Organiza tus páginas con colecciones Guarda y categoriza el contenido según tus preferencias.
La API de Display & Video 360 es la interfaz programática de la plataforma de Display & Video 360. Puedes usar la API de Display & Video 360 para automatizar flujos de trabajo complejos de Display & Video 360. Estos son algunos ejemplos de tareas que puedes realizar con la API de Display & Video 360:
En esta guía, se describe cómo comenzar a usar la API de Display & Video 360.
Requisitos previos
Antes de usar la API de Display & Video 360, debes hacer lo siguiente:
Debes tener una Cuenta de Google. Necesitas una Cuenta de Google para crear un proyecto en la Consola de API de Google. Si ya tienes una cuenta, no tienes que hacer nada más. También puedes usar una Cuenta de Google independiente para fines de prueba.
Debes tener acceso a Display & Video 360. Necesitas acceso al producto Display & Video 360 para trabajar con la API. Si tu organización ya tiene un contrato de Display & Video 360, asegúrate de que se haya creado un perfil de usuario con los permisos adecuados para tus Cuentas de Google. De lo contrario, comunícate con nuestro equipo de ventas para obtener más información.
Te recomendamos que pruebes Display & Video 360. En esta documentación de la API, se da por sentado que usaste Display & Video 360 y que conoces los conceptos de programación web y los formatos de datos web. Si no usaste Display & Video 360, prueba la IU web antes de comenzar a codificar.
Puedes crear un proyecto nuevo o usar uno existente.
Crea un proyecto nuevo
Sigue los pasos que se indican en la Consola de APIs de Google para crear un proyecto y habilitar automáticamente la API de Display & Video 360.
Usa un proyecto existente
A continuación, te mostramos cómo activar manualmente la API de Display & Video 360 para un proyecto existente.
Si deseas habilitar una API para tu proyecto, haz lo siguiente:
Abre la Biblioteca de APIs en la Consola de APIs de Google. Si se te solicita, selecciona un proyecto o crea uno nuevo. La Biblioteca de API muestra todas las APIs disponibles, agrupadas por familia de productos y popularidad.
Si la API que quieres habilitar no está en la lista, usa la búsqueda para encontrarla.
Selecciona la API que deseas habilitar y, luego, haz clic en el botón Habilitar.
Si se te solicita, habilita la facturación.
Si se te solicita, acepta las Condiciones del Servicio de la API.
Genera credenciales
Se deben autorizar todas las solicitudes que realices a la API de Display & Video 360. Para obtener una breve descripción general de la autorización, lee sobre cómo autorizar e identificar tu aplicación a Google.
Las siguientes instrucciones te guiarán por el proceso de creación de un ID de cliente de OAuth 2.0 para usarlo con el flujo de la aplicación instalada. Si deseas obtener instrucciones para generar credenciales para usar con el flujo de la cuenta de servicio, consulta la guía Cuentas de servicio.
Haz clic en Crear credenciales > ID de cliente de OAuth.
Selecciona el tipo de aplicación más aplicable cuando se te solicite. Los fragmentos de código de Java y Python que se ofrecen en estas guías suponen una app para computadoras, mientras que los fragmentos de código de PHP suponen una aplicación web.
Ingresa la información adicional requerida.
Si es la primera vez que creas un ID de cliente, además de poder seleccionar el tipo de aplicación, puedes configurar la pantalla de consentimiento haciendo clic en el botón Configurar pantalla de consentimiento. No recibirás un mensaje para volver a configurar la pantalla de consentimiento después de hacerlo por primera vez, aunque esta información se puede actualizar en cualquier momento.
Haz clic en Crear.
Cuando termines, se te mostrará un ID de cliente y un secreto de cliente de OAuth 2.0, que puedes descargar en formato JSON y guardar para usarlos más adelante.
Configura la pantalla de consentimiento del usuario
Cuando usas OAuth 2.0 para la autenticación, tus usuarios se autentican después de aceptar los términos que se presentan en una pantalla de consentimiento del usuario.
Para establecer la pantalla de consentimiento de tu proyecto, haz lo siguiente:
Abre la página Pantalla de consentimiento en la consola de la API de Google. Si se te solicita, selecciona un proyecto o crea uno nuevo.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-25 (UTC)"],[[["\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**."]]