A nova API Search Ads 360 Reporting já está disponível. Participe do grupo do Google searchads-api-announcements para ficar por dentro das próximas melhorias e versões.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Uma opção para gerar credenciais do OAuth2 é usar o OAuth2 Playground. O OAuth2 Playground, junto com o console da API Google Ads,
permite criar tokens OAuth2 manualmente.
O OAuth2 Playground é para usuários que só precisam acessar as contas de uma conta de administrador ou de um usuário do Google Ads único. Se você precisar solicitar credenciais de vários usuários, é melhor configurar uma biblioteca de cliente para OAuth no Search Ads 360.
Na lista suspensa do projeto, selecione um projeto existente ou crie um novo.
Na página "Credenciais", selecione Criar credenciais e depois ID do cliente OAuth.
Em Tipo de aplicativo, escolha Aplicativo da Web.
Em URIs de redirecionamento autorizados, adicione uma linha com:
https://developers.google.com/oauthplayground
Clique em Criar.
Na página "ID do cliente", anote o ID do cliente e a chave secreta do cliente.
Você precisará deles na próxima etapa.
Se você já tiver um projeto na nuvem, poderá reutilizá-lo definindo os URIs de redirecionamento autorizados como acima.
Gerar tokens
Acesse o OAuth2 Playground. Usar este link vai preencher alguns valores-chave para você.
Clique no ícone de engrenagem no canto superior direito e marque a caixa Usar suas próprias credenciais do OAuth (se ainda não estiver marcada).
Confira se:
o fluxo do OAuth está definido como Servidor;
O tipo de acesso está definido como Off-line. Isso garante que você receba um token de atualização e um token de acesso, em vez de apenas um token de acesso.
Insira o código do cliente do OAuth2 e a chave secreta do cliente do OAuth2 que você adquiriu acima.
Na seção Etapa 1: selecionar e autorizar APIs, clique em API Reporting do Search Ads 360 na lista e selecione o escopo dela, https://www.googleapis.com/auth/doubleclicksearch. Depois, clique em Autorizar APIs:
Se solicitado, faça login na conta a que você quer conceder acesso e autorização. Caso contrário, confirme se o usuário atual no canto superior direito é o cliente ou a conta de administrador para quem você quer receber credenciais.
Uma solicitação aparece indicando que o app quer gerenciar suas campanhas do Search Ads 360. Clique em Aceitar para continuar.
Na guia Etapa 2: trocar código de autorização por tokens,
um código de autorização vai aparecer. Clique em
Trocar código de autorização por tokens.
Se tudo correr bem, os campos Token de atualização e Token de acesso serão preenchidos automaticamente. Talvez seja necessário abrir novamente a Etapa 2: trocar código de autorização por tokens:
Copie o token de atualização no arquivo de configuração da biblioteca
de cliente escolhida, junto com o ID do cliente e a chave secreta do cliente.
Remover o OAuth2 Playground do seu código do cliente
Agora que você tem um token de atualização, não é mais necessário que o OAuth2 Playground seja um URI de redirecionamento autorizado. Para remover da lista de URIs de redirecionamento
autorizados:
Na lista suspensa de projetos, selecione seu projeto.
Na página "Credenciais", clique no nome do código do cliente para editá-lo.
Remova https://developers.google.com/oauthplayground dos URIs de redirecionamento autorizados. É necessário deixar pelo menos um URI de redirecionamento no lugar.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-26 UTC."],[[["\u003cp\u003eThe OAuth2 Playground enables manual creation of OAuth2 tokens for single manager account or Google Ads user access.\u003c/p\u003e\n"],["\u003cp\u003eTo use the OAuth2 Playground, you need a client ID and client secret generated for a web application in the Google API Console.\u003c/p\u003e\n"],["\u003cp\u003eGenerate refresh and access tokens using the OAuth2 Playground by authorizing the Search Ads 360 Reporting API.\u003c/p\u003e\n"],["\u003cp\u003eConfigure your client library using the generated refresh token, client ID, and client secret for Search Ads 360 API access.\u003c/p\u003e\n"],["\u003cp\u003eAfter obtaining the refresh token, remove the OAuth2 Playground from the authorized redirect URIs in your Google API Console project.\u003c/p\u003e\n"]]],["To generate OAuth2 credentials via the OAuth2 Playground, first create a web application client ID and secret in the Google API Console, adding `https://developers.google.com/oauthplayground` as an authorized redirect URI. Next, navigate to the OAuth2 Playground, input your credentials, and select the Search Ads 360 Reporting API scope. Authorize the API, exchange the authorization code for tokens, and copy the refresh token, client ID, and client secret to your client library configuration. Finally, remove the OAuth2 Playground URI from your authorized redirect URIs.\n"],null,["# OAuth Playground\n\nOne option for generating OAuth2 credentials is to use the **OAuth2\nPlayground**. The OAuth2 Playground, in conjunction with the Google Ads API console,\nlets you manually create OAuth2 tokens.\n\nThe OAuth2 Playground is for users who only need to access the accounts for a\n*single* manager account or Google Ads user. If you need to prompt multiple\nusers for credentials, it is likely better to configure a [client library](/search-ads/reporting/client-libraries/client-libraries) for\nOAuth in Search Ads 360.\n\nGet a client ID and client secret\n---------------------------------\n\n| **Warning:** To use the **OAuth2 Playground** , you need to generate a **client\n| ID** for a [web application](/identity/protocols/OAuth2WebServer). This is the *only* type of application that works with the OAuth2 Playground. Refer to [Choose an application\n| type](/google-ads/api/docs/oauth/cloud-project#choose_an_application_type) for more information.\n\nIf you do not have an existing cloud project:\n\n1. Open the [Google API Console\n Credentials page](https://console.cloud.google.com/apis/credentials).\n\n2. From the project drop-down, select an existing project or create a new one.\n\n3. On the Credentials page, select **Create credentials** , then select\n **OAuth client ID**.\n\n4. Under **Application type** , choose **Web application**.\n\n5. Under **Authorized redirect URIs** , add a line with:\n `https://developers.google.com/oauthplayground`\n\n6. Click **Create**.\n\n7. On the Client ID page, take note of the **client ID** and **client secret**.\n You'll need these in the next step.\n\nIf you have an existing cloud project, you can reuse it by setting the\nAuthorized redirect URIs as above.\n\nGenerate tokens\n---------------\n\n| **Warning:** The Search Ads 360 user you're signed in as in your browser determines which accounts you'll be able to access with the OAuth2 credentials you generate. Therefore, you may want to do these steps in an incognito window or when you're not signed in to your Search Ads 360 account, since it's likely that the user whose credentials you want to use isn't the same user you were signed in as when you got the client ID and secret.\n\n1. Go to the [OAuth2\n Playground](https://developers.google.com/oauthplayground/#step1&scopes=https%3A//www.googleapis.com/auth/doubleclicksearch&url=https%3A//&content_type=application/json&http_method=GET&useDefaultOauthCred=checked&oauthEndpointSelect=Google&oauthAuthEndpointValue=https%3A//accounts.google.com/o/oauth2/v2/auth&oauthTokenEndpointValue=https%3A//oauth2.googleapis.com/token&includeCredentials=unchecked&accessTokenType=bearer&autoRefreshToken=unchecked&accessType=offline&forceAprovalPrompt=checked&response_type=code),\n (using this link should pre-populate some key values for you).\n\n2. Click the gear icon\n in the upper right corner and check the box labeled **Use your own OAuth\n credentials** (if it isn't already checked).\n\n3. Make sure that:\n\n - **OAuth flow** is set to **Server-side**.\n - **Access type** is set to **Offline** (this ensures you get a refresh token *and* an access token, instead of just an access token).\n4. Enter the **OAuth2 client ID** and **OAuth2 client secret** you obtained above.\n\n5. In the section labeled **Step 1 - Select \\& authorize APIs** , click **Search Ads 360 Reporting API** from the list and select its scope,\n `https://www.googleapis.com/auth/doubleclicksearch`. Then click **Authorize APIs**:\n\n6. If prompted, sign in to the account to which you want to grant access and\n authorization. Otherwise, confirm that the current user in the top\n right corner is the client or manager account for whom you want to obtain\n credentials.\n\n | If you got your client ID and secret only a few minutes ago, and you get an error such as **Error: redirect_uri_mismatch** , the changes you made may not have propagated. Click the back button in your browser, wait a few minutes, then try clicking **Authorize APIs** again.\n\n \u003cbr /\u003e\n\n | If you get an error that you have not been granted access by the developer and the app is currently being tested, you will need to visit the OAuth consent screen page within your GCP project and do one of the following:\n |\n | \u003cbr /\u003e\n |\n | - Publish the app.\n |\n | - Keep the app in the Testing status, and add yourself as a test user.\n |\n \u003cbr /\u003e\n\n7. A prompt appears indicating your app would like to\n **Manage your Search Ads 360 campaigns** . Click **Accept** to continue.\n\n8. In the tab labeled **Step 2 - Exchange authorization code for tokens** ,\n an **Authorization code** should appear. Click\n **Exchange authorization code for tokens**.\n\n9. If all goes well, the **Refresh token** and **Access token** should be\n filled in for you (you may have to re-expand\n **Step 2 - Exchange authorization code for tokens**):\n\n10. Copy the **Refresh token** into the configuration file for your client\n library of choice, along with the **client ID** and **client secret**.\n\n11. [Configure a client library for OAuth in the Search Ads 360 Reporting API](/search-ads/reporting/client-libraries/client-libraries).\n\nRemove the OAuth2 Playground from your client ID\n------------------------------------------------\n\nNow that you have a **refresh token**, you no longer need the OAuth2 Playground\nto be an authorized redirect URI. To remove it from the list of authorized\nredirect URIs:\n\n1. Go to the [Google API Console Credentials page](https://console.cloud.google.com/apis/credentials).\n\n2. From the project drop-down, select your project.\n\n3. On the Credentials page, click the **client ID name** to edit.\n\n4. Remove `https://developers.google.com/oauthplayground` from the **Authorized\n redirect URIs** . Note that you must leave at least *one* redirect URI in\n place.\n\n5. Click **Save**."]]