Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Veja como usar a API CSS:
Permissões
Para trabalhar com a API CSS, configure as permissões em dois lugares: Google Cloud e Central do CSS.
Google Cloud IAM:
Crie uma conta de serviço no console do Google Cloud. Siga instruções
semelhantes às da API
Content
para criar e baixar o arquivo JSON de credenciais. Esta etapa
autentica sua conta de serviço como uma entidade válida do Google Cloud.
Se você estiver usando o acesso REST direto ou as bibliotecas de cliente da API do Google,
também vai precisar de uma chave de
API gerada
no Console do Google Cloud.
CSS Center:
O endereço de e-mail da conta de serviço (por exemplo,
your-service-account-name@your-project-id.iam.gserviceaccount.com)
precisa ser adicionado como usuário com acesso de administrador à sua conta do CSS Center. Essa etapa autoriza a conta de serviço a acessar e gerenciar
os dados da Central do CSS.
É possível conceder acesso no nível do grupo do CSS (para acesso a todos os domínios) ou a contas específicas de domínio do CSS. Para acesso à API, é comum conceder acesso no nível do grupo do CSS.
Para adicionar a conta de serviço:
Faça login no CSS Center com um usuário administrador.
Acesse Acesso à conta (abaixo do ícone de engrenagem ⚙️).
Clique em + Adicionar usuário e insira o e-mail da conta de serviço.
Defina o nível de acesso como Administrador.
A propagação das permissões pode levar até 30 minutos. Se você encontrar erros de permissão, tente de novo mais tarde.
Escopo de autenticação:
O escopo do OAuth 2.0 necessário para a API CSS é:
https://www.googleapis.com/auth/content
Verifique se o aplicativo solicita esse escopo ao fazer a autenticação.
[[["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-13 UTC."],[[["\u003cp\u003eTo use the CSS API, create a service account with Admin access, enable the API in your Google Cloud project, and start programming using provided samples and libraries.\u003c/p\u003e\n"],["\u003cp\u003eSend requests to the CSS API using the specified URL format, replacing placeholders with relevant resource names and methods.\u003c/p\u003e\n"],["\u003cp\u003eThe CSS API supports both gRPC (recommended) and REST for making calls, with gRPC being the default for client libraries.\u003c/p\u003e\n"],["\u003cp\u003eFor support or to report issues, contact your Google representative or utilize the provided feedback channels for API features, documentation, or samples.\u003c/p\u003e\n"],["\u003cp\u003eSubmit feedback through designated forms or buttons for API features, documentation, samples and libraries or general feedback after task implementation.\u003c/p\u003e\n"]]],[],null,["# Get started with the CSS API\n\nHere's how to use the CSS API:\n\nPermissions\n-----------\n\nTo work with the CSS API, you need to configure permissions in two places:\nGoogle Cloud and CSS Center.\n\n1. **Google Cloud IAM:**\n\n - Create a service account in the [Google Cloud\n Console](https://console.cloud.google.com/apis/library). Follow similar [instructions as for the Content\n API](https://developers.google.com/shopping-content/guides/how-tos/service-accounts) to create and download the JSON credentials file. This step authenticates your service account as a valid Google Cloud entity.\n - If you're using direct REST access or the Google API Client libraries, you also need an [API\n Key](https://cloud.google.com/docs/authentication/api-keys) generated from the Google Cloud Console.\n2. **CSS Center:**\n\n - The service account email address (e.g., `your-service-account-name@your-project-id.iam.gserviceaccount.com`) must be added as a user with **Admin access** to your CSS Center account. This step authorizes the service account to access and manage your CSS Center data.\n - You can grant access at the CSS Group level (for access to all domains) or to specific CSS Domain accounts. For API access, granting access at the CSS Group level is common.\n - To add the service account:\n - Sign in to CSS Center with an administrator user.\n - Navigate to **Account access** (under the gear icon ⚙️).\n - Click **+ Add user** and enter the service account email.\n - Set the access level to **Admin**.\n - Permissions may take up to 30 minutes to propagate. If you encounter permission errors, try again later.\n\n**Authentication Scope:**\n\nThe required OAuth 2.0 scope for the CSS API is:\n\n- `https://www.googleapis.com/auth/content`\n\nVerify that your application requests this scope when authenticating.\n\nEnable the CSS API\n------------------\n\nIn order to use the CSS API, you need to enable it in your Google Cloud project.\nYou can find the library at\n\u003chttps://console.cloud.google.com/apis/library/css.googleapis.com\u003e.\n\nStart programming\n-----------------\n\nThe CSS API has [code samples](/comparison-shopping-services/api/code-samples),\nand [client libraries](/comparison-shopping-services/api/client-libraries) to\nhelp you get started. We also have a\n[best practices](/comparison-shopping-services/api/guides/best_practices) page.\n\nSend requests\n-------------\n\nSend requests to URLs in the following format: \n\n https://css.googleapis.com/\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-p\"\u003e{\u003c/span\u003eversion\u003cspan class=\"devsite-syntax-p\"\u003e}\u003c/span\u003e\u003c/var\u003e/\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-p\"\u003e{\u003c/span\u003eresource name\u003cspan class=\"devsite-syntax-p\"\u003e}\u003c/span\u003e\u003c/var\u003e:\u003cvar translate=\"no\"\u003e{method\u003cspan class=\"devsite-syntax-p\"\u003e}\u003c/span\u003e\u003c/var\u003e...\n\nWhere \u003cvar translate=\"no\"\u003e{resource name}\u003c/var\u003e is the name of the resource\nyour call impacts.\n\nFor example, here's how to delete a resource with gRPC: \n\n https://css.googleapis.com/v1/\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-p\"\u003e{\u003c/span\u003eresource name\u003cspan class=\"devsite-syntax-p\"\u003e}\u003c/span\u003e\u003c/var\u003e:delete\n\nHere's how to delete a resource with REST: \n\n DELETE https://css.googleapis.com/v1/\u003cvar translate=\"no\"\u003e{resource name}\u003c/var\u003e\n\nSee the CSS API\n[reference documentation](/comparison-shopping-services/api/reference/rpc)\nfor more details on specific services.\n\nUse gRPC or REST\n----------------\n\nThe CSS API supports [gRPC](//grpc.io/docs/guides/) and\n[REST](//en.wikipedia.org/wiki/Representational_state_transfer). Here are the\ntwo ways to make CSS API calls:\n\n| gRPC (recommended) | REST |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1. Create the body of the request as a protocol buffer. 2. Send the request body to the server with HTTP/2. 3. Deserialize the response to a protocol buffer. 4. Interpret the results. | 1. Create the body of request as a JSON object. 2. Send it to the server using HTTP 1.1. 3. Deserialize the response as a JSON object. 4. Interpret the results. |\n\n| **Note:** If you use a client library, the default transport mechanism is gRPC. In most cases you don't need to do anything other than call the CSS API endpoints to use gRPC.\n\nGet help\n--------\n\nContact your Google representative for support, or use the [feedback\nform](https://support.google.com/css-center/gethelp) to report any issues.\n\nHere's how you can provide more feedback if you experience issues:\n\nGive feedback\n-------------\n\nTo provide feedback, submit one of the following:\n\n- **API features:** Submit the [feedback\n form](https://support.google.com/css-center/gethelp)\n- **Documentation:** Use the in-page thumb ratings and **Send feedback** button.\n- **Samples and libraries:** Use the **New issue** button on GitHub.\n\nTo provide general feedback after implementing each task, use the [feedback\nform](https://support.google.com/css-center/gethelp)."]]