{"id":19101125,"url":"https://github.com/googleads/googleads-shopping-samples","last_synced_at":"2025-04-04T10:08:50.563Z","repository":{"id":37484167,"uuid":"20530014","full_name":"googleads/googleads-shopping-samples","owner":"googleads","description":"Samples for the Content API for Shopping and the Manufacturer Center API","archived":false,"fork":false,"pushed_at":"2024-03-13T13:48:27.000Z","size":791,"stargazers_count":190,"open_issues_count":29,"forks_count":271,"subscribers_count":47,"default_branch":"main","last_synced_at":"2024-04-14T04:48:48.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developers.google.com/shopping-content/","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":null,"contributing":null,"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":"2014-06-05T15:16:46.000Z","updated_at":"2024-06-20T11:01:44.884Z","dependencies_parsed_at":"2023-01-24T21:45:44.998Z","dependency_job_id":"bb542ad9-7385-419f-85fb-a90f88b3173a","html_url":"https://github.com/googleads/googleads-shopping-samples","commit_stats":{"total_commits":198,"total_committers":10,"mean_commits":19.8,"dds":"0.20707070707070707","last_synced_commit":"6dacf611ca9d2f48511b9c2ca5d74ed6c2fc4e79"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-shopping-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-shopping-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-shopping-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-shopping-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleads","download_url":"https://codeload.github.com/googleads/googleads-shopping-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"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":[],"created_at":"2024-11-09T03:53:10.424Z","updated_at":"2025-04-04T10:08:50.542Z","avatar_url":"https://github.com/googleads.png","language":"Java","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# Samples for the Content API for Shopping and Manufacturer Center API\n\nThese code samples are organized by platform or language. Each language\ndirectory contains a `README` with more information about how to run the\nsamples for that particular language.  Here, we cover setting up\nauthentication and the common configuration file used by all the samples.\n\nFor more information on the APIs, please refer to the documentation for the\n[Content API for Shopping](https://developers.google.com/shopping-content/)\nand the\n[Manufacturer Center API](https://developers.google.com/manufacturers/).\n\n## Choose Your Method of Authentication\n\nBefore getting started, check the Getting Started section of the\n[Content API for Shopping documentation](https://developers.google.com/shopping-content/v2/quickstart).\nYou may want to use\n[service accounts](https://developers.google.com/shopping-content/guides/how-tos/service-accounts)\ninstead to simplify the authentication flow. These samples also support using\n[Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).\n\nSetting up authentication for the Manufacturer Center API is similar to the\nContent API. Just make sure to select the Manufacturer Center API in the API\nConsole. Both APIs can be selected if you wish to try samples for both APIs.\n\n## Setting up Authentication and Sample Configuration\n\n1.  Create the directory `$(HOME)/shopping-samples` to store the\n    configuration.\n\n    If you are unsure where this will be located in your particular setup, then\n    run the samples (following the language-specific `README`). Errors\n    from the samples related to either this directory or necessary files not\n    existing will provide the full path to the expected directory/files.\n\n    Within this directory, also create the following subdirectories, depending\n    on which API you would like to try:\n\n    * `content` for the Content API for Shopping\n    * `manufacturers` for the Manufacturer Center API\n\n    Place the files described below in the appropriate subdirectory for the API\n    you want to try.\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    *   Put the JSON file you downloaded when creating the service account to\n        the file `service-account.json` in the appropriate API configuration\n        subdirectories.\n\n    If you are using an OAuth2 client ID:\n\n    *   Download your [OAuth2 client\n        credentials](https://console.developers.google.com/apis/credentials) to\n        the file `client-secrets.json` in the appropriate API configuration\n        subdirectories.\n\n        **Note:** The samples assume that you are using an OAuth2 client ID that\n        can use a loopback IP address to retrieve tokens. If you are not or are\n        unsure that you are, please visit the\n        [OAuth2.0 for Mobile \u0026 Desktop Apps]\n        (https://developers.google.com/identity/protocols/OAuth2InstalledApp)\n        page and follow the instructions there to create a new OAuth2 client ID\n        to use with the samples.\n\n    You can set up multiple authentication methods to try out different flows,\n    but note that the samples will always use the first credentials that can be\n    loaded, in the 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.  [OAuth2\n        client](https://developers.google.com/shopping-content/v2/how-tos/authorizing)\n        credentials\n\n3.  Each set of samples uses a different configuration file.  For the Content\n    API for Shopping, take the example `merchant-info.json` from the repository\n    root and copy it into `$(HOME)/shopping-samples/content`.  Next, change its\n    contents appropriately. It contains a JSON object with the following fields:\n\n    | Field                     | Type   | Description                                    |\n    |---------------------------|--------|------------------------------------------------|\n    | `merchantId`              | number | The Merchant Center ID to run samples against. |\n    | `accountSampleUser`       | string | If non-empty, the email address for the user to add/remove in samples for the `Accounts` service. |\n    | `accountSampleAdWordsCID` | number | If non-zero, the AdWords Customer ID to link/unlink in samples for the `Accounts` service. |\n\n    For the Manufacturer Center API, take the example `manufacturer-info.json`\n    from the repository root and copy it into\n    `$(HOME)/shopping-samples/manufacturers`.  Next, change its contents\n    appropriately. It contains a JSON object with the following fields:\n\n    | Field                     | Type   | Description                                    |\n    |---------------------------|--------|------------------------------------------------|\n    | `manufacturerId`          | number | The Manufacturer Center ID to run samples against. |\n    | `websiteUrl`              | string | The URL (without trailing slash) associated with the Manufacturer Center account. |\n\n    If using OAuth2 client credentials, once you have authorized access, your\n    token details will be stored in the `stored-token.json` file in the samples\n    configuration directory. If you have any issues authenticating, remove this\n    file and you will be asked to re-authorize access.\n\n## Try Out the Samples\n\nNow that you've configured both the common sample configuration file and set up\nyour authentication credentials, it's time to build and run any of the included\nsamples.  As mentioned before, there are language-specific instructions in\nthe `README`s located in each language subdirectory. Have fun!\n\n## Possible Issues\n\n* When using the Content API for Shopping, if you haven't set up tax settings on\n  your account, you may get an error when running certain samples. If you\n  receive a \"missing tax settings\" error, set your tax settings in the Merchant\n  Center before trying these samples.  Selecting the \"Don't charge taxes in the\n  United States\" setting is sufficient.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleads%2Fgoogleads-shopping-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleads%2Fgoogleads-shopping-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleads%2Fgoogleads-shopping-samples/lists"}