rocket
Content API for Shopping의 공식 후속 API인
Merchant API를 만나보세요.
update
새로운 Merchant API 기능, 버그 수정, 업데이트에 관한
최신 소식을 확인하세요.
add_alert
참고: Content API for Shopping은 2026년 8월 18일에 지원이 종료됩니다.
요청 수행
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 가이드에서는 시작하기 가이드를 살펴보고 승인된 요청을 할 수 있도록 설정했다고 가정합니다.
모든 설정을 완료한 후 Google Content API for Shopping에 요청을 보낼 수 있습니다. 다음 코드 샘플은 몇 가지 간단한 요청을 보내는 방법을 보여줍니다.
- 제품을 만듭니다.
- 제품 목록을 가져옵니다.
- 목록에서 특정 제품을 가져옵니다.
- 제품의 가격을 업데이트합니다.
전체 메서드 목록은
참조 문서를 참고하세요.
자세한 내용은 API를 가장 효과적으로 사용하는 방법을 설명하는 권장사항 페이지를 참고하세요.
이 페이지에서는 일괄 요청이 권장되는 이유도 설명합니다.
Content API에 문제가 있는 경우
판매자 센터 상태 대시보드에서 서비스 중단 여부를 확인하고 지원 페이지를 확인하세요.
제품 만들기
제품에 있을 수 있는 모든 속성의 전체 세부정보는 제품 피드 사양에서 확인할 수 있습니다.
제품을 만들려면
다음 코드를 사용하세요.
프로토콜
POST /content/v2.1/YOUR_MERCHANT_ID/products
{
"offerId": "book123",
"title": "A Tale of Two Cities",
"description": "A classic novel about the French Revolution",
"link": "http://my-book-shop.com/tale-of-two-cities.html",
"imageLink": "http://my-book-shop.com/tale-of-two-cities.jpg",
"contentLanguage": "en",
"targetCountry": "GB",
"feedLabel": "GB",
"channel": "online",
"availability": "in stock",
"condition": "new",
"googleProductCategory": "Media > Books",
"gtin": "9780007350896",
"price": {
"value": "2.50",
"currency": "GBP"
},
"shipping": [{
"country": "GB",
"service": "Standard shipping",
"price": {
"value": "0.99",
"currency": "GBP"
}
}],
"shippingWeight": {
"value": "200",
"unit": "grams"
}
}
자바
Product product = new Product();
product.setOfferId("book123");
product.setTitle("A Tale of Two Cities");
product.setDescription("A classic novel about the French Revolution");
product.setLink("http://my-book-shop.com/tale-of-two-cities.html");
product.setImageLink("http://my-book-shop.com/tale-of-two-cities.jpg");
product.setContentLanguage("en");
product.setTargetCountry("GB");
product.setChannel("online");
product.setAvailability("in stock");
product.setCondition("new");
product.setGoogleProductCategory("Media > Books");
product.setGtin("9780007350896");
Price price = new Price();
price.setValue("2.50");
price.setCurrency("GBP");
product.setPrice(price);
Price shippingPrice = new Price();
shippingPrice.setValue("0.99");
shippingPrice.setCurrency("GBP");
ProductShipping shipping = new ProductShipping();
shipping.setPrice(shippingPrice);
shipping.setCountry("GB");
shipping.setService("Standard shipping");
ArrayList shippingList = new ArrayList();
shippingList.add(shipping);
product.setShipping(shippingList);
Product result = service.products().insert(merchantId, product).execute();
PHP
$product = new Google_Service_ShoppingContent_Product();
$product->setOfferId('book123');
$product->setTitle('A Tale of Two Cities');
$product->setDescription('A classic novel about the French Revolution');
$product->setLink('http://my-book-shop.com/tale-of-two-cities.html');
$product->setImageLink('http://my-book-shop.com/tale-of-two-cities.jpg');
$product->setContentLanguage('en');
$product->setTargetCountry('GB');
$product->setChannel('online');
$product->setAvailability('in stock');
$product->setCondition('new');
$product->setGoogleProductCategory('Media > Books');
$product->setGtin('9780007350896');
$price = new Google_Service_ShoppingContent_Price();
$price->setValue('2.50');
$price->setCurrency('GBP');
$shipping_price = new Google_Service_ShoppingContent_Price();
$shipping_price->setValue('0.99');
$shipping_price->setCurrency('GBP');
$shipping = new Google_Service_ShoppingContent_ProductShipping();
$shipping->setPrice($shipping_price);
$shipping->setCountry('GB');
$shipping->setService('Standard shipping');
$shipping_weight = new Google_Service_ShoppingContent_ProductShippingWeight();
$shipping_weight->setValue(200);
$shipping_weight->setUnit('grams');
$product->setPrice($price);
$product->setShipping(array($shipping));
$product->setShippingWeight($shipping_weight);
$result = $service->products->insert($merchant_id, $product);
제품 목록 가져오기
제품 목록을 가져오려면 다음 코드를 사용하세요.
프로토콜
GET /content/v2.1/YOUR_MERCHANT_ID/products
자바
List productsList = service.products().list(merchantId);
ProductsListResponse page = productsList.execute();
while ((page.getResources() != null) && !page.getResources().isEmpty()) {
for (Product product : page.getResources()) {
System.out.printf("%s %s%n", product.getId(), product.getTitle());
}
if (page.getNextPageToken() == null) {
break;
}
productsList.setPageToken(page.getNextPageToken());
page = productsList.execute();
}
PHP
$products = $service->products->listProducts($merchantId);
$parameters = array();
while (!empty($products->getResources()) {
foreach ($products->getResources() as $product) {
printf("%s %s\n", $product->getId(), $product->getTitle());
}
if (!empty($products->getNextPageToken()) {
break;
}
$parameters['pageToken'] = $products->nextPageToken;
$products = $service->products->listProducts($merchantId, $parameters);
}
특정 제품 가져오기
목록에서 특정 제품을 가져오려면 다음 코드를 사용하세요.
프로토콜
GET /content/v2.1/YOUR_MERCHANT_ID/products/online:en:GB:book123
자바
Product product = service.products()
.get(merchantId, "online:en:GB:book123")
.execute();
System.out.printf("%s %s\n", product.getId(), product.getTitle());
PHP
$product = $service->products->get($merchant_id, 'online:en:GB:book123');
printf("%s %s\n", $product->getId(), $product->getTitle());
온라인 제품 재고 업데이트
제품 리소스에서
보조 피드를 사용하여 다음 코드로 온라인 제품 데이터를 업데이트할 수 있습니다.
프로토콜
POST /content/v2.1/YOUR_MERCHANT_ID/products?YOUR_SUPPLEMENTAL_FEED_ID
{
"offerId": "book123",
"contentLanguage": "en",
"targetCountry": "GB",
"feedLabel": "GB",
"channel": "online",
"availability": "out of stock"
}
자바
Product product = new Product();
// Mandatory Fields
product.setOfferId("book123");
product.setContentLanguage("en");
product.setTargetCountry("GB");
product.setChannel("online");
// Optional Fields to Update
product.setAvailability("out of stock");
// Your unique supplemental feedId
feedId=123456789
Product result = service.products().insert(merchantId, product, feedId).execute();
PHP
$product = new Google_Service_ShoppingContent_Product();
// Mandatory Fields
$product->setOfferId('book123');
$product->setContentLanguage('en');
$product->setTargetCountry('GB');
$product->setChannel('online');
// Optional Fields to Update
$product->setAvailability('out of stock');
// Your unique supplemental feedId
$feedId=123456789
$result = $service->products->insert($merchant_id, $product, $feedId);
오프라인 제품 재고 업데이트
오프라인 판매점 인벤토리 서비스를 사용하여 다음 코드로 오프라인 제품 데이터를 업데이트할 수 있습니다.
프로토콜
POST /content/v2.1/YOUR_MERCHANT_ID/localinventory/online/products/online:en:GB:book123
{
"availability": "out of stock"
}
자바
Product product = new Product();
// Mandatory Fields
product.setOfferId("book123");
product.setContentLanguage("en");
product.setTargetCountry("GB");
product.setChannel("online");
// Optional Fields to Update
product.setAvailability("out of stock");
Product result = service.localinventory().insert(merchantId, product).execute();
PHP
$product = new Google_Service_ShoppingContent_Product();
// Mandatory Fields
$product->setOfferId('book123');
$product->setContentLanguage('en');
$product->setTargetCountry('GB');
$product->setChannel('online');
// Optional Fields to Update
$product->setAvailability('out of stock');
$result = $service->localinventory->insert($merchant_id, $product);
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of product data integration with Google.\u003c/p\u003e\n"],["\u003cp\u003eThis guide provides code samples to manage products, including creating, retrieving, listing, and updating them via the API.\u003c/p\u003e\n"],["\u003cp\u003eYou can find comprehensive details on product attributes in the Products Feed Specification and best practices for using the API in the provided links.\u003c/p\u003e\n"],["\u003cp\u003eUtilize supplemental feeds to update online product data and the Local Inventory service to manage local product information efficiently.\u003c/p\u003e\n"],["\u003cp\u003eFor support or to check for service outages, refer to the Merchant Center status dashboard and the Support page.\u003c/p\u003e\n"]]],["The Merchant API beta, a new version of the Content API for Shopping, allows users to manage product data. Key actions include creating a product with details like title, price, and shipping, retrieving a list of products, and fetching a specific product. Additionally, users can update product availability for both online and local inventory using supplemental feeds or the local inventory service. The provided code examples demonstrate these actions in Protocol, Java, and PHP.\n"],null,["# Make requests\n\nThis guide assumes you've worked through\nour [Getting Started](/shopping-content/guides/quickstart) guide and are set up to\nmake authorized requests.\n\nAfter you've set everything up, you can send requests to the Google Content API for Shopping. The following code\nsamples demonstrate how to send a few simple requests:\n\n- Create a product.\n- Get a list of products.\n- Retrieve a specific product from the list.\n- Update a product's price.\n\nFor a full list of methods, see the [reference documentation](/shopping-content/reference/rest/v2.1).\n\nFor more information, see the [Best Practices](/shopping-content/guides/best-practices) page, which\nexplains how to best use the API.\nThis page also explains why batch requests are recommended.\n\n\nIf you're having issues with the Content API, check the [Merchant Center status dashboard](//merchants.google.com/status) for outages, and the\n[Support](/shopping-content/support/contact-us) page.\n\n### Create a product\n\nYou can find full details of all the attributes that a product can have in the\n[Products Feed Specification](//support.google.com/merchants/answer/188494).\nTo [create a product](/shopping-content/reference/rest/v2.1/products/insert), use the following code: \n\nProtocol\n--------\n\n```scdoc\nPOST /content/v2.1/YOUR_MERCHANT_ID/products\n\n{\n \"offerId\": \"book123\",\n \"title\": \"A Tale of Two Cities\",\n \"description\": \"A classic novel about the French Revolution\",\n \"link\": \"http://my-book-shop.com/tale-of-two-cities.html\",\n \"imageLink\": \"http://my-book-shop.com/tale-of-two-cities.jpg\",\n \"contentLanguage\": \"en\",\n \"targetCountry\": \"GB\",\n \"feedLabel\": \"GB\",\n \"channel\": \"online\",\n \"availability\": \"in stock\",\n \"condition\": \"new\",\n \"googleProductCategory\": \"Media \u003e Books\",\n \"gtin\": \"9780007350896\",\n \"price\": {\n \"value\": \"2.50\",\n \"currency\": \"GBP\"\n },\n \"shipping\": [{\n \"country\": \"GB\",\n \"service\": \"Standard shipping\",\n \"price\": {\n \"value\": \"0.99\",\n \"currency\": \"GBP\"\n }\n }],\n \"shippingWeight\": {\n \"value\": \"200\",\n \"unit\": \"grams\"\n }\n}\n```\n\nJava\n----\n\n```java\nProduct product = new Product();\n\nproduct.setOfferId(\"book123\");\nproduct.setTitle(\"A Tale of Two Cities\");\nproduct.setDescription(\"A classic novel about the French Revolution\");\nproduct.setLink(\"http://my-book-shop.com/tale-of-two-cities.html\");\nproduct.setImageLink(\"http://my-book-shop.com/tale-of-two-cities.jpg\");\nproduct.setContentLanguage(\"en\");\nproduct.setTargetCountry(\"GB\");\nproduct.setChannel(\"online\");\nproduct.setAvailability(\"in stock\");\nproduct.setCondition(\"new\");\nproduct.setGoogleProductCategory(\"Media \u003e Books\");\nproduct.setGtin(\"9780007350896\");\n\nPrice price = new Price();\nprice.setValue(\"2.50\");\nprice.setCurrency(\"GBP\");\nproduct.setPrice(price);\n\nPrice shippingPrice = new Price();\nshippingPrice.setValue(\"0.99\");\nshippingPrice.setCurrency(\"GBP\");\n\nProductShipping shipping = new ProductShipping();\nshipping.setPrice(shippingPrice);\nshipping.setCountry(\"GB\");\nshipping.setService(\"Standard shipping\");\n\nArrayList shippingList = new ArrayList();\nshippingList.add(shipping);\nproduct.setShipping(shippingList);\n\nProduct result = service.products().insert(merchantId, product).execute();\n```\n\nPHP\n---\n\n```php\n$product = new Google_Service_ShoppingContent_Product();\n$product-\u003esetOfferId('book123');\n$product-\u003esetTitle('A Tale of Two Cities');\n$product-\u003esetDescription('A classic novel about the French Revolution');\n$product-\u003esetLink('http://my-book-shop.com/tale-of-two-cities.html');\n$product-\u003esetImageLink('http://my-book-shop.com/tale-of-two-cities.jpg');\n$product-\u003esetContentLanguage('en');\n$product-\u003esetTargetCountry('GB');\n$product-\u003esetChannel('online');\n$product-\u003esetAvailability('in stock');\n$product-\u003esetCondition('new');\n$product-\u003esetGoogleProductCategory('Media \u003e Books');\n$product-\u003esetGtin('9780007350896');\n\n$price = new Google_Service_ShoppingContent_Price();\n$price-\u003esetValue('2.50');\n$price-\u003esetCurrency('GBP');\n\n$shipping_price = new Google_Service_ShoppingContent_Price();\n$shipping_price-\u003esetValue('0.99');\n$shipping_price-\u003esetCurrency('GBP');\n\n$shipping = new Google_Service_ShoppingContent_ProductShipping();\n$shipping-\u003esetPrice($shipping_price);\n$shipping-\u003esetCountry('GB');\n$shipping-\u003esetService('Standard shipping');\n\n$shipping_weight = new Google_Service_ShoppingContent_ProductShippingWeight();\n$shipping_weight-\u003esetValue(200);\n$shipping_weight-\u003esetUnit('grams');\n\n$product-\u003esetPrice($price);\n$product-\u003esetShipping(array($shipping));\n$product-\u003esetShippingWeight($shipping_weight);\n\n$result = $service-\u003eproducts-\u003einsert($merchant_id, $product);\n```\n\n### Get a list of products\n\nTo [get a list of\nproducts](/shopping-content/reference/rest/v2.1/products/list), use the following code: \n\nProtocol\n--------\n\n```scdoc\nGET /content/v2.1/YOUR_MERCHANT_ID/products\n```\n\nJava\n----\n\n```text\nList productsList = service.products().list(merchantId);\n\nProductsListResponse page = productsList.execute();\nwhile ((page.getResources() != null) && !page.getResources().isEmpty()) {\n for (Product product : page.getResources()) {\n System.out.printf(\"%s %s%n\", product.getId(), product.getTitle());\n }\n\n if (page.getNextPageToken() == null) {\n break;\n }\n\n productsList.setPageToken(page.getNextPageToken());\n page = productsList.execute();\n}\n```\n\nPHP\n---\n\n```ecl\n$products = $service-\u003eproducts-\u003elistProducts($merchantId);\n$parameters = array();\nwhile (!empty($products-\u003egetResources()) {\n foreach ($products-\u003egetResources() as $product) {\n printf(\"%s %s\\n\", $product-\u003egetId(), $product-\u003egetTitle());\n }\n if (!empty($products-\u003egetNextPageToken()) {\n break;\n }\n $parameters['pageToken'] = $products-\u003enextPageToken;\n $products = $service-\u003eproducts-\u003elistProducts($merchantId, $parameters);\n}\n```\n\n### Retrieve a specific product\n\nTo [retrieve a specific\nproduct from the list](/shopping-content/reference/rest/v2.1/products/get), use the following code: \n\nProtocol\n--------\n\n```scdoc\nGET /content/v2.1/YOUR_MERCHANT_ID/products/online:en:GB:book123\n```\n\nJava\n----\n\n```css+lasso\nProduct product = service.products()\n .get(merchantId, \"online:en:GB:book123\")\n .execute();\nSystem.out.printf(\"%s %s\\n\", product.getId(), product.getTitle());\n```\n\nPHP\n---\n\n```css+lasso\n$product = $service-\u003eproducts-\u003eget($merchant_id, 'online:en:GB:book123');\nprintf(\"%s %s\\n\", $product-\u003egetId(), $product-\u003egetTitle());\n```\n\n### Update online product availability\n\nYou can use [Supplemental Feeds](/shopping-content/guides/products/supplemental-feeds) in the Products resource to update online product data with the following\ncode: \n\nProtocol\n--------\n\n```scdoc\nPOST /content/v2.1/YOUR_MERCHANT_ID/products?YOUR_SUPPLEMENTAL_FEED_ID\n\n{\n \"offerId\": \"book123\",\n \"contentLanguage\": \"en\",\n \"targetCountry\": \"GB\",\n \"feedLabel\": \"GB\",\n \"channel\": \"online\",\n \"availability\": \"out of stock\"\n}\n```\n\nJava\n----\n\n```text\nProduct product = new Product();\n// Mandatory Fields\nproduct.setOfferId(\"book123\");\nproduct.setContentLanguage(\"en\");\nproduct.setTargetCountry(\"GB\");\nproduct.setChannel(\"online\");\n\n// Optional Fields to Update\nproduct.setAvailability(\"out of stock\");\n\n// Your unique supplemental feedId\nfeedId=123456789\n\nProduct result = service.products().insert(merchantId, product, feedId).execute();\n```\n\nPHP\n---\n\n```ecl\n$product = new Google_Service_ShoppingContent_Product();\n// Mandatory Fields\n$product-\u003esetOfferId('book123');\n$product-\u003esetContentLanguage('en');\n$product-\u003esetTargetCountry('GB');\n$product-\u003esetChannel('online');\n\n// Optional Fields to Update\n$product-\u003esetAvailability('out of stock');\n\n// Your unique supplemental feedId\n$feedId=123456789\n\n$result = $service-\u003eproducts-\u003einsert($merchant_id, $product, $feedId);\n```\n\n### Update local product availability\n\nYou can use the [Local Inventory Service](/shopping-content/reference/rest/v2.1/localinventory) to update local product data with the following code: \n\nProtocol\n--------\n\n```scdoc\nPOST /content/v2.1/YOUR_MERCHANT_ID/localinventory/online/products/online:en:GB:book123\n\n{\n \"availability\": \"out of stock\"\n}\n```\n\nJava\n----\n\n```text\nProduct product = new Product();\n// Mandatory Fields\nproduct.setOfferId(\"book123\");\nproduct.setContentLanguage(\"en\");\nproduct.setTargetCountry(\"GB\");\nproduct.setChannel(\"online\");\n\n// Optional Fields to Update\nproduct.setAvailability(\"out of stock\");\n\nProduct result = service.localinventory().insert(merchantId, product).execute();\n```\n\nPHP\n---\n\n```ecl\n$product = new Google_Service_ShoppingContent_Product();\n// Mandatory Fields\n$product-\u003esetOfferId('book123');\n$product-\u003esetContentLanguage('en');\n$product-\u003esetTargetCountry('GB');\n$product-\u003esetChannel('online');\n\n// Optional Fields to Update\n$product-\u003esetAvailability('out of stock');\n\n$result = $service-\u003elocalinventory-\u003einsert($merchant_id, $product);\n```"]]