PHPackages                             googleads/shopping-content-samples - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. googleads/shopping-content-samples

ActiveProject[API Development](/categories/api)

googleads/shopping-content-samples
==================================

Samples for the Content API for Shopping

v2.x-dev(7y ago)20733262[22 issues](https://github.com/googleads/googleads-shopping-samples/issues)[13 PRs](https://github.com/googleads/googleads-shopping-samples/pulls)Apache-2.0JavaPHP &gt;=5.4CI passing

Since Aug 29Pushed 1w ago42 watchersCompare

[ Source](https://github.com/googleads/googleads-shopping-samples)[ Packagist](https://packagist.org/packages/googleads/shopping-content-samples)[ Docs](https://developers.google.com/shopping-content/)[ RSS](/packages/googleads-shopping-content-samples/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (9)Used By (0)

Meet Merchant API - the official successor to Content API for Shopping.
-----------------------------------------------------------------------

[](#meet-merchant-api---the-official-successor-to-content-api-for-shopping)

Check out the [Merchant API code samples repository](https://github.com/google/merchant-api-samples)Get the latest on new [Merchant API](https://developers.google.com/merchant/api) features, bug fixes, and updates. [Get started with Merchant API](https://developers.google.com/merchant/api/guides/quickstart) and get access to data, insights, and unique capabilities at scale.

Important

The Content API for Shopping is approaching sunset on August 18, 2026., and its code samples are therefore no longer maintained. We recommend using Merchant API instead.

Samples for the Content API for Shopping and Manufacturer Center API
====================================================================

[](#samples-for-the-content-api-for-shopping-and-manufacturer-center-api)

These code samples are organized by platform or language. Each language directory contains a `README` with more information about how to run the samples for that particular language. ere, we cover setting up authentication and the common configuration file used by all the samples.

For more information on the APIs, please refer to the documentation for the [Content API for Shopping](https://developers.google.com/shopping-content/)and the [Manufacturer Center API](https://developers.google.com/manufacturers/).

Choose Your Method of Authentication
------------------------------------

[](#choose-your-method-of-authentication)

Before getting started, check the Getting Started section of the [Content API for Shopping documentation](https://developers.google.com/shopping-content/v2/quickstart). You may want to use [service accounts](https://developers.google.com/shopping-content/guides/how-tos/service-accounts)instead to simplify the authentication flow. These samples also support using [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).

Setting up authentication for the Manufacturer Center API is similar to the Content API. Just make sure to select the Manufacturer Center API in the API Console. Both APIs can be selected if you wish to try samples for both APIs.

Setting up Authentication and Sample Configuration
--------------------------------------------------

[](#setting-up-authentication-and-sample-configuration)

1. Create the directory `$(HOME)/shopping-samples` to store the configuration.

    If you are unsure where this will be located in your particular setup, then run the samples (following the language-specific `README`). Errors from the samples related to either this directory or necessary files not existing will provide the full path to the expected directory/files.

    Within this directory, also create the following subdirectories, depending on which API you would like to try:

    - `content` for the Content API for Shopping
    - `manufacturers` for the Manufacturer Center API

    Place the files described below in the appropriate subdirectory for the API you want to try.
2. Set up your desired authentication method.

    If you are using Google Application Default Credentials:

    - Follow the directions on the [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials)page.

    If you are using a service account:

    - Put the JSON file you downloaded when creating the service account to the file `service-account.json` in the appropriate API configuration subdirectories.

    If you are using an OAuth2 client ID:

    - Download your [OAuth2 client credentials](https://console.developers.google.com/apis/credentials) to the file `client-secrets.json` in the appropriate API configuration subdirectories.

        **Note:** The samples assume that you are using an OAuth2 client ID that can use a loopback IP address to retrieve tokens. If you are not or are unsure that you are, please visit the \[OAuth2.0 for Mobile &amp; Desktop Apps\] () page and follow the instructions there to create a new OAuth2 client ID to use with the samples.

    You can set up multiple authentication methods to try out different flows, but note that the samples will always use the first credentials that can be loaded, in the order:

    1. [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials)
    2. [Service accounts](https://developers.google.com/shopping-content/v2/how-tos/service-accounts)credentials
    3. [OAuth2 client](https://developers.google.com/shopping-content/v2/how-tos/authorizing)credentials
3. Each set of samples uses a different configuration file. or the Content API for Shopping, take the example `merchant-info.json` from the repository root and copy it into `$(HOME)/shopping-samples/content`. ext, change its contents appropriately. It contains a JSON object with the following fields:

    FieldTypeDescription`merchantId`numberThe Merchant Center ID to run samples against.`accountSampleUser`stringIf non-empty, the email address for the user to add/remove in samples for the `Accounts` service.`accountSampleAdWordsCID`numberIf non-zero, the AdWords Customer ID to link/unlink in samples for the `Accounts` service.For the Manufacturer Center API, take the example `manufacturer-info.json`from the repository root and copy it into `$(HOME)/shopping-samples/manufacturers`. ext, change its contents appropriately. It contains a JSON object with the following fields:

    FieldTypeDescription`manufacturerId`numberThe Manufacturer Center ID to run samples against.`websiteUrl`stringThe URL (without trailing slash) associated with the Manufacturer Center account.If using OAuth2 client credentials, once you have authorized access, your token details will be stored in the `stored-token.json` file in the samples configuration directory. If you have any issues authenticating, remove this file and you will be asked to re-authorize access.

Try Out the Samples
-------------------

[](#try-out-the-samples)

Now that you've configured both the common sample configuration file and set up your authentication credentials, it's time to build and run any of the included samples. As mentioned before, there are language-specific instructions in the `README`s located in each language subdirectory. Have fun!

Possible Issues
---------------

[](#possible-issues)

- When using the Content API for Shopping, if you haven't set up tax settings on your account, you may get an error when running certain samples. If you receive a "missing tax settings" error, set your tax settings in the Merchant Center before trying these samples. Selecting the "Don't charge taxes in the United States" setting is sufficient.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance61

Regular maintenance activity

Popularity30

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2861d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39109?v=4)[Tess Strickland](/maintainers/sstrickl)[@sstrickl](https://github.com/sstrickl)

---

Top Contributors

[![sstrickl](https://avatars.githubusercontent.com/u/39109?v=4)](https://github.com/sstrickl "sstrickl (157 commits)")[![Brothman](https://avatars.githubusercontent.com/u/5422354?v=4)](https://github.com/Brothman "Brothman (60 commits)")[![xflesym](https://avatars.githubusercontent.com/u/6520230?v=4)](https://github.com/xflesym "xflesym (9 commits)")[![damaz91](https://avatars.githubusercontent.com/u/178889034?v=4)](https://github.com/damaz91 "damaz91 (4 commits)")[![yufengg](https://avatars.githubusercontent.com/u/4944507?v=4)](https://github.com/yufengg "yufengg (4 commits)")[![wibblymat](https://avatars.githubusercontent.com/u/393358?v=4)](https://github.com/wibblymat "wibblymat (3 commits)")[![JoseAlcerreca](https://avatars.githubusercontent.com/u/609125?v=4)](https://github.com/JoseAlcerreca "JoseAlcerreca (2 commits)")[![AnashOommen](https://avatars.githubusercontent.com/u/4514952?v=4)](https://github.com/AnashOommen "AnashOommen (1 commits)")[![fblascogarma](https://avatars.githubusercontent.com/u/62343770?v=4)](https://github.com/fblascogarma "fblascogarma (1 commits)")

### Embed Badge

![Health badge](/badges/googleads-shopping-content-samples/health.svg)

```
[![Health](https://phpackages.com/badges/googleads-shopping-content-samples/health.svg)](https://phpackages.com/packages/googleads-shopping-content-samples)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.4M25](/packages/googleads-googleads-php-lib)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[google/cloud

Google Cloud Client Library

1.2k16.5M57](/packages/google-cloud)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
