{"id":19176868,"url":"https://github.com/googleads/comparison-shopping-service-api-samples","last_synced_at":"2025-02-23T01:16:26.177Z","repository":{"id":233141240,"uuid":"728217798","full_name":"googleads/comparison-shopping-service-api-samples","owner":"googleads","description":"Code samples for the Comparison Shopping Service API (CSS API)","archived":false,"fork":false,"pushed_at":"2024-09-19T16:24:27.000Z","size":23,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-09T10:38:49.010Z","etag":null,"topics":["code-samples","code-samples-java","css-api"],"latest_commit_sha":null,"homepage":"https://developers.google.com/comparison-shopping-services/api","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleads.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-06T13:32:14.000Z","updated_at":"2024-02-09T09:35:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"565dd90c-ba1e-4272-ada4-6bc9d2856f93","html_url":"https://github.com/googleads/comparison-shopping-service-api-samples","commit_stats":null,"previous_names":["googleads/comparison-shopping-service-api-samples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fcomparison-shopping-service-api-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fcomparison-shopping-service-api-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fcomparison-shopping-service-api-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fcomparison-shopping-service-api-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleads","download_url":"https://codeload.github.com/googleads/comparison-shopping-service-api-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232417290,"owners_count":18519698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-samples","code-samples-java","css-api"],"created_at":"2024-11-09T10:30:51.758Z","updated_at":"2025-01-04T02:29:21.748Z","avatar_url":"https://github.com/googleads.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Comparison Shopping Service API Samples\n\nThis repository contains code samples for the Comparison Shopping Service API\n(CSS API). The code samples are categorized by platform/language. Each language\ndirectory contains a `README` file with more information on how to run the\nsamples for that particular language.\n\nThis document covers setting up authentication and the common configuration file\nused by all the samples. For more information on the API, please refer to the\n[CSS API documentation](https://developers.google.com/comparison-shopping-services/api).\n\n\n## Choose Your Method of Authentication\n\nBefore getting started, check the [Getting Started](https://developers.google.com/comparison-shopping-services/api/guides/quickstart)\nsection of the CSS API documentation.\nYou may want to use\n[service accounts](https://developers.google.com/shopping-content/v2/how-tos/service-accounts)\nto simplify the authentication flow. These samples also support using\n[Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).\n\n\u003e **Note**\n\u003e The current CSS API sample code only demonstrates the use of service accounts\n\u003e for authentication. Other [OAuth](https://developers.google.com/shopping-content/guides/how-tos/authorizing)\n\u003e authentication methods are also supported, but these are not explicitly\n\u003e demonstrated in the API samples.\n\n## Setting up Authentication and Sample Configuration\n\n1.  Create the directory `$(HOME)/comparison-shopping-service-api/config` to store the\n    configuration.\n\n    If you are unsure of the location of this directory in your particular\n    setup, you may run the samples (following the language-specific `README`).\n    Errors from the samples that relate to this directory or necessary files not\n    existing will provide the full path to the expected directory or files.\n\n2.  Set up your desired authentication method.\n\n    If you are using Google Application Default Credentials:\n\n    *   Follow the directions on the [Google Application Default\n        Credentials](https://developers.google.com/identity/protocols/application-default-credentials)\n        page.\n\n    If you are using a service account:\n\n    *   Rename the JSON file downloaded during service account creation to\n        `service-account.json` in the `config` directory.\n\n    If you are using an OAuth 2.0 client ID:\n\n    *   Download your [OAuth 2.0 client credentials](https://console.developers.google.com/apis/credentials)\n        to the file `client-secrets.json` in the `config` directory.\n\n        **Note:** The samples assume that you are using an OAuth 2.0 client ID\n        that can use a loopback IP address to retrieve tokens. If you are not or\n        are unsure that you are, please visit the\n        [OAuth 2.0 for Mobile \u0026 Desktop Apps](https://developers.google.com/identity/protocols/OAuth2InstalledApp)\n        page and follow the instructions there to create a new OAuth 2.0 client ID\n        to use with the samples.\n\n    It is possible to set up multiple authentication methods for testing\n    different flows, but it is important to note that the samples will always\n    use the first credentials that can be loaded, in the following order:\n\n    1.  [Google Application Default\n        Credentials](https://developers.google.com/identity/protocols/application-default-credentials)\n    2.  [Service\n        accounts](https://developers.google.com/shopping-content/v2/how-tos/service-accounts)\n        credentials\n    3.  [OAuth 2.0\n        client](https://developers.google.com/shopping-content/v2/how-tos/authorizing)\n        credentials\n\n3.  Copy the example `account-info.json` file from the repository root to\n    `$HOME/comparison-shopping-service-api/config`. Then, modify its contents as\n    needed. The file contains a JSON object with the following fields:\n\n    | Field                     | Type   | Description                                    |\n    |---------------------------|--------|------------------------------------------------|\n    | `groupId`                 | number | The CSS Group ID to run samples against.       |\n    | `domainId`                | number | The CSS Domain ID to run samples against.      |\n    | `merchantId`              | number | The Merchant Center ID to run samples against. |\n\n    If OAuth 2.0 client credentials are used, the token details will be stored in\n    the `stored-token.json` file in the samples configuration directory after\n    authorization has been granted. If authentication issues are encountered,\n    the file can be removed and the user will be prompted to re-authorize access.\n\n## Try Out the Samples\n\nOnce the common sample configuration file has been configured and authentication\ncredentials have been set up, it is time to build and run any of the included\nsamples. As previously mentioned, language-specific instructions are available\nin the `README`s located in each language subdirectory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleads%2Fcomparison-shopping-service-api-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleads%2Fcomparison-shopping-service-api-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleads%2Fcomparison-shopping-service-api-samples/lists"}