@biggora/claude-plugins 1.1.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +3 -1
- package/README.md +24 -17
- package/package.json +1 -1
- package/registry/registry.json +319 -244
- package/specs/coding.md +24 -0
- package/specs/pod.md +2 -0
- package/src/skills/captcha/README.md +221 -0
- package/src/skills/captcha/SKILL.md +355 -0
- package/src/skills/captcha/references/captcha-types.md +254 -0
- package/src/skills/captcha/references/services.md +172 -0
- package/src/skills/captcha/references/stealth.md +238 -0
- package/src/skills/captcha/scripts/solve_captcha.py +323 -0
- package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
- package/src/skills/codex-cli/SKILL.md +21 -11
- package/src/skills/gemini-cli/SKILL.md +27 -13
- package/src/skills/gemini-cli/references/commands.md +21 -14
- package/src/skills/gemini-cli/references/configuration.md +23 -18
- package/src/skills/gemini-cli/references/headless-and-scripting.md +7 -17
- package/src/skills/gemini-cli/references/mcp-and-extensions.md +12 -6
- package/src/skills/google-merchant-api/SKILL.md +581 -0
- package/src/skills/google-merchant-api/references/accounts.md +247 -0
- package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
- package/src/skills/google-merchant-api/references/datasources.md +233 -0
- package/src/skills/google-merchant-api/references/inventories.md +201 -0
- package/src/skills/google-merchant-api/references/migration.md +267 -0
- package/src/skills/google-merchant-api/references/products.md +316 -0
- package/src/skills/google-merchant-api/references/promotions.md +201 -0
- package/src/skills/google-merchant-api/references/reports.md +240 -0
- package/src/skills/lv-aggregators-api/SKILL.md +113 -0
- package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
- package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
- package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
- package/src/skills/notebook-lm/SKILL.md +1 -1
- package/src/skills/screen-recording/SKILL.md +243 -213
- package/src/skills/screen-recording/references/design-patterns.md +4 -2
- package/src/skills/screen-recording/references/ffmpeg-recording.md +473 -0
- package/src/skills/screen-recording/references/{approach1-programmatic.md → programmatic-generation.md} +45 -22
- package/src/skills/screen-recording/references/python-fallback.md +222 -0
- package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
- package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
- package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
- package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
- package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
- package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
- package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
- package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
- package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
- package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
- package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
- package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
- package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
- package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
- package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
- package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
- package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
- package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
- package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
- package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
- package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
- package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
- package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
- package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
- package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
- package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
- package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
- package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
- package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
- package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
- package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
- package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
- package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
- package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
- package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
- package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
- package/src/skills/test-mobile-app/SKILL.md +11 -6
- package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
- package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
- package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
- package/src/skills/test-web-ui/SKILL.md +264 -84
- package/src/skills/test-web-ui/scripts/discover.py +25 -12
- package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
- package/src/skills/tm-search/SKILL.md +242 -106
- package/src/skills/tm-search/references/scraping-fallback.md +60 -95
- package/src/skills/tm-search/scripts/tm_search.py +453 -375
- package/src/skills/vite-best-practices/SKILL.md +115 -0
- package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
- package/src/skills/vite-best-practices/references/core-config.md +231 -0
- package/src/skills/vite-best-practices/references/core-features.md +222 -0
- package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
- package/src/skills/vite-best-practices/references/environment-api.md +108 -0
- package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
- package/src/skills/screen-recording/references/approach2-xvfb.md +0 -232
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: google-merchant-api
|
|
3
|
+
description: >
|
|
4
|
+
Use this skill whenever the user wants to work with Google Merchant Center APIs,
|
|
5
|
+
including the new Merchant API (v1) or the legacy Content API for Shopping (v2.1).
|
|
6
|
+
Triggers include: uploading or managing products, product feeds, inventory management
|
|
7
|
+
(local/regional), promotions, data sources, reports, merchant reviews, product reviews,
|
|
8
|
+
shipping settings, account management, order tracking, conversion sources, or any
|
|
9
|
+
Google Shopping integration. Also use for tasks like "add products to Google Shopping",
|
|
10
|
+
"sync inventory with Merchant Center", "set up product feeds", "manage promotions",
|
|
11
|
+
"get shopping performance reports", "migrate from Content API to Merchant API",
|
|
12
|
+
"configure shipping in Merchant Center", or "upload product data to Google".
|
|
13
|
+
Use this skill even when the user mentions e-commerce product feeds, Google Shopping
|
|
14
|
+
listings, or product data specifications without explicitly naming the API.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Google Merchant API
|
|
18
|
+
|
|
19
|
+
Programmatically manage Google Merchant Center accounts, products, inventory, promotions, and more.
|
|
20
|
+
|
|
21
|
+
## API Landscape
|
|
22
|
+
|
|
23
|
+
Google provides two APIs for Merchant Center. The **Merchant API (v1)** is the current standard. The **Content API for Shopping (v2.1)** is the legacy API, sunsetting **August 18, 2026**.
|
|
24
|
+
|
|
25
|
+
| Aspect | Merchant API (v1) | Content API for Shopping (v2.1) |
|
|
26
|
+
|--------|-------------------|----------------------------------|
|
|
27
|
+
| Base URL | `https://merchantapi.googleapis.com` | `https://shoppingcontent.googleapis.com` |
|
|
28
|
+
| Transport | gRPC (default) + REST | REST only |
|
|
29
|
+
| Status | Active, GA | Sunset August 18, 2026 |
|
|
30
|
+
| Design | Modular sub-APIs | Monolithic |
|
|
31
|
+
| Batching | Async / HTTP batching | `customBatch` methods |
|
|
32
|
+
|
|
33
|
+
**Always prefer the Merchant API for new integrations.** Only use Content API if maintaining legacy code or if a feature hasn't migrated yet.
|
|
34
|
+
|
|
35
|
+
## Authentication
|
|
36
|
+
|
|
37
|
+
Both APIs use Google OAuth 2.0. Two approaches:
|
|
38
|
+
|
|
39
|
+
### Service Account (server-to-server)
|
|
40
|
+
|
|
41
|
+
Best for automated backends. Create a service account in Google Cloud Console, download the JSON key, and grant it access in Merchant Center.
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
// Node.js with google-auth-library
|
|
45
|
+
const { GoogleAuth } = require('google-auth-library');
|
|
46
|
+
|
|
47
|
+
const auth = new GoogleAuth({
|
|
48
|
+
keyFile: 'service-account-key.json',
|
|
49
|
+
scopes: ['https://www.googleapis.com/auth/content'],
|
|
50
|
+
});
|
|
51
|
+
const client = await auth.getClient();
|
|
52
|
+
const token = await client.getAccessToken();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
# Python with google-auth
|
|
57
|
+
from google.oauth2 import service_account
|
|
58
|
+
|
|
59
|
+
credentials = service_account.Credentials.from_service_account_file(
|
|
60
|
+
'service-account-key.json',
|
|
61
|
+
scopes=['https://www.googleapis.com/auth/content']
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### OAuth 2.0 Client (user-interactive)
|
|
66
|
+
|
|
67
|
+
Best for apps acting on behalf of merchants. Requires consent flow.
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
// Node.js OAuth2 flow
|
|
71
|
+
const { OAuth2Client } = require('google-auth-library');
|
|
72
|
+
|
|
73
|
+
const oauth2Client = new OAuth2Client(
|
|
74
|
+
CLIENT_ID,
|
|
75
|
+
CLIENT_SECRET,
|
|
76
|
+
REDIRECT_URI
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Generate auth URL
|
|
80
|
+
const authUrl = oauth2Client.generateAuthUrl({
|
|
81
|
+
access_type: 'offline',
|
|
82
|
+
scope: ['https://www.googleapis.com/auth/content'],
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Exchange code for tokens
|
|
86
|
+
const { tokens } = await oauth2Client.getToken(code);
|
|
87
|
+
oauth2Client.setCredentials(tokens);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Required scope:** `https://www.googleapis.com/auth/content`
|
|
91
|
+
|
|
92
|
+
### Setup Prerequisites
|
|
93
|
+
|
|
94
|
+
1. Create a Google Cloud project
|
|
95
|
+
2. Enable the "Google Merchant API" (or "Content API for Shopping" for legacy)
|
|
96
|
+
3. Create credentials (service account or OAuth client)
|
|
97
|
+
4. Register the GCP project with your Merchant Center account via developer registration
|
|
98
|
+
|
|
99
|
+
## Merchant API Architecture
|
|
100
|
+
|
|
101
|
+
The Merchant API is organized into **14 independent sub-APIs**, each versioned separately:
|
|
102
|
+
|
|
103
|
+
| Sub-API | Purpose | Stable Version |
|
|
104
|
+
|---------|---------|----------------|
|
|
105
|
+
| **Accounts** | Account settings, users, shipping, business info, programs | v1 |
|
|
106
|
+
| **Products** | Product inputs and processed products | v1 |
|
|
107
|
+
| **Inventories** | Local and regional inventory | v1 |
|
|
108
|
+
| **Data Sources** | Feed management (API, file, autofeed) | v1 |
|
|
109
|
+
| **Reports** | Performance and market insights | v1 |
|
|
110
|
+
| **Promotions** | Promotional campaigns | v1 |
|
|
111
|
+
| **Conversions** | Conversion source tracking | v1 |
|
|
112
|
+
| **Notifications** | Push notifications for product changes | v1 |
|
|
113
|
+
| **Reviews** | Product and merchant reviews | v1beta |
|
|
114
|
+
| **Order Tracking** | Shipping signal tracking | v1 |
|
|
115
|
+
| **LFP** | Local Feeds Partnership | v1 |
|
|
116
|
+
| **Quota** | API usage limits | v1 |
|
|
117
|
+
| **Issue Resolution** | Product/account issue handling | v1 |
|
|
118
|
+
| **Product Studio** | AI-powered image/text generation | v1alpha |
|
|
119
|
+
|
|
120
|
+
For detailed endpoints and schemas for each sub-API, read the corresponding file in `references/`.
|
|
121
|
+
|
|
122
|
+
## URL Structure
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
https://merchantapi.googleapis.com/{SUB_API}/{VERSION}/{RESOURCE_NAME}:{METHOD}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Standard REST methods (GET, POST, PATCH, DELETE) omit the `:{METHOD}` suffix. Custom methods use the suffix.
|
|
129
|
+
|
|
130
|
+
**Examples:**
|
|
131
|
+
```
|
|
132
|
+
GET .../products/v1/accounts/123456/products/en~US~sku123
|
|
133
|
+
POST .../products/v1/accounts/123456/productInputs:insert
|
|
134
|
+
DELETE .../products/v1/accounts/123456/productInputs/en~US~sku123
|
|
135
|
+
POST .../reports/v1/accounts/123456/reports:search
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Resource Naming
|
|
139
|
+
|
|
140
|
+
Resources use hierarchical names instead of flat IDs:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
accounts/{account_id}
|
|
144
|
+
accounts/{account_id}/products/{product_id}
|
|
145
|
+
accounts/{account_id}/products/{product_id}/localInventories/{store_code}
|
|
146
|
+
accounts/{account_id}/products/{product_id}/regionalInventories/{region_id}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Product identifier format:** `{contentLanguage}~{feedLabel}~{offerId}`
|
|
150
|
+
- Example: `en~US~sku123`
|
|
151
|
+
- Legacy local products: prefix with `local~` (e.g., `local~en~US~sku123`)
|
|
152
|
+
|
|
153
|
+
**Base64url encoding required** when product names contain special characters: `% . + / : ~ , ( * ! ) & ? = @ # $`
|
|
154
|
+
|
|
155
|
+
## Core Workflows
|
|
156
|
+
|
|
157
|
+
### Insert a Product
|
|
158
|
+
|
|
159
|
+
Products are managed through the split `productInputs` (write) / `products` (read) model.
|
|
160
|
+
|
|
161
|
+
```javascript
|
|
162
|
+
// Node.js - Insert a product via Merchant API
|
|
163
|
+
const fetch = require('node-fetch');
|
|
164
|
+
|
|
165
|
+
const MERCHANT_ID = '123456789';
|
|
166
|
+
const DATA_SOURCE_ID = '987654321';
|
|
167
|
+
|
|
168
|
+
const productInput = {
|
|
169
|
+
offerId: 'SKU-001',
|
|
170
|
+
contentLanguage: 'en',
|
|
171
|
+
feedLabel: 'US',
|
|
172
|
+
productAttributes: {
|
|
173
|
+
title: 'Premium Wireless Headphones',
|
|
174
|
+
description: 'Noise-cancelling Bluetooth headphones with 30hr battery',
|
|
175
|
+
link: 'https://example.com/headphones',
|
|
176
|
+
imageLink: 'https://example.com/images/headphones.jpg',
|
|
177
|
+
availability: 'in_stock',
|
|
178
|
+
condition: 'new',
|
|
179
|
+
price: { amountMicros: '79990000', currencyCode: 'USD' }, // $79.99
|
|
180
|
+
brand: 'AudioBrand',
|
|
181
|
+
gtin: '0123456789012',
|
|
182
|
+
googleProductCategory: 'Electronics > Audio > Headphones',
|
|
183
|
+
channel: 'ONLINE',
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const response = await fetch(
|
|
188
|
+
`https://merchantapi.googleapis.com/products/v1/accounts/${MERCHANT_ID}/productInputs:insert?dataSource=accounts/${MERCHANT_ID}/dataSources/${DATA_SOURCE_ID}`,
|
|
189
|
+
{
|
|
190
|
+
method: 'POST',
|
|
191
|
+
headers: {
|
|
192
|
+
'Authorization': `Bearer ${accessToken}`,
|
|
193
|
+
'Content-Type': 'application/json',
|
|
194
|
+
},
|
|
195
|
+
body: JSON.stringify(productInput),
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
# Python - Insert a product via Merchant API
|
|
202
|
+
import requests
|
|
203
|
+
|
|
204
|
+
MERCHANT_ID = '123456789'
|
|
205
|
+
DATA_SOURCE_ID = '987654321'
|
|
206
|
+
|
|
207
|
+
product_input = {
|
|
208
|
+
'offerId': 'SKU-001',
|
|
209
|
+
'contentLanguage': 'en',
|
|
210
|
+
'feedLabel': 'US',
|
|
211
|
+
'productAttributes': {
|
|
212
|
+
'title': 'Premium Wireless Headphones',
|
|
213
|
+
'description': 'Noise-cancelling Bluetooth headphones with 30hr battery',
|
|
214
|
+
'link': 'https://example.com/headphones',
|
|
215
|
+
'imageLink': 'https://example.com/images/headphones.jpg',
|
|
216
|
+
'availability': 'in_stock',
|
|
217
|
+
'condition': 'new',
|
|
218
|
+
'price': {'amountMicros': '79990000', 'currencyCode': 'USD'},
|
|
219
|
+
'brand': 'AudioBrand',
|
|
220
|
+
'gtin': '0123456789012',
|
|
221
|
+
'googleProductCategory': 'Electronics > Audio > Headphones',
|
|
222
|
+
'channel': 'ONLINE',
|
|
223
|
+
},
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
response = requests.post(
|
|
227
|
+
f'https://merchantapi.googleapis.com/products/v1/accounts/{MERCHANT_ID}/productInputs:insert',
|
|
228
|
+
params={'dataSource': f'accounts/{MERCHANT_ID}/dataSources/{DATA_SOURCE_ID}'},
|
|
229
|
+
headers={'Authorization': f'Bearer {access_token}', 'Content-Type': 'application/json'},
|
|
230
|
+
json=product_input,
|
|
231
|
+
)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**The `dataSource` query parameter is required for all write operations.**
|
|
235
|
+
|
|
236
|
+
### List Products
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
240
|
+
"https://merchantapi.googleapis.com/products/v1/accounts/$MERCHANT_ID/products?pageSize=50"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Response includes pagination:
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"products": [...],
|
|
247
|
+
"nextPageToken": "abc123"
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
Pass `pageToken=abc123` for the next page.
|
|
251
|
+
|
|
252
|
+
### Update Inventory
|
|
253
|
+
|
|
254
|
+
```javascript
|
|
255
|
+
// Update local inventory for a store
|
|
256
|
+
const localInventory = {
|
|
257
|
+
storeCode: 'STORE-NYC-01',
|
|
258
|
+
availability: 'in_stock',
|
|
259
|
+
price: { amountMicros: '69990000', currencyCode: 'USD' },
|
|
260
|
+
quantity: '25',
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
await fetch(
|
|
264
|
+
`https://merchantapi.googleapis.com/inventories/v1/accounts/${MERCHANT_ID}/products/en~US~SKU-001/localInventories`,
|
|
265
|
+
{
|
|
266
|
+
method: 'POST',
|
|
267
|
+
headers: {
|
|
268
|
+
'Authorization': `Bearer ${token}`,
|
|
269
|
+
'Content-Type': 'application/json',
|
|
270
|
+
},
|
|
271
|
+
body: JSON.stringify(localInventory),
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Query Reports
|
|
277
|
+
|
|
278
|
+
```javascript
|
|
279
|
+
// Get product performance data
|
|
280
|
+
const query = {
|
|
281
|
+
query: `
|
|
282
|
+
SELECT
|
|
283
|
+
segments.offer_id,
|
|
284
|
+
segments.title,
|
|
285
|
+
metrics.clicks,
|
|
286
|
+
metrics.impressions,
|
|
287
|
+
metrics.ctr
|
|
288
|
+
FROM product_performance_view
|
|
289
|
+
WHERE segments.date BETWEEN '2024-01-01' AND '2024-01-31'
|
|
290
|
+
ORDER BY metrics.clicks DESC
|
|
291
|
+
LIMIT 100
|
|
292
|
+
`,
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const response = await fetch(
|
|
296
|
+
`https://merchantapi.googleapis.com/reports/v1/accounts/${MERCHANT_ID}/reports:search`,
|
|
297
|
+
{
|
|
298
|
+
method: 'POST',
|
|
299
|
+
headers: {
|
|
300
|
+
'Authorization': `Bearer ${token}`,
|
|
301
|
+
'Content-Type': 'application/json',
|
|
302
|
+
},
|
|
303
|
+
body: JSON.stringify(query),
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Reports use a **SQL-like query language** with `SELECT`, `FROM`, `WHERE`, `ORDER BY`, and `LIMIT`.
|
|
309
|
+
|
|
310
|
+
Available report tables:
|
|
311
|
+
- `product_performance_view` - Clicks, impressions, CTR
|
|
312
|
+
- `non_product_performance_view` - Website traffic analytics
|
|
313
|
+
- `price_competitiveness_product_view` - Price benchmarking
|
|
314
|
+
- `price_insights_product_view` - Pricing optimization
|
|
315
|
+
- `best_sellers_product_cluster_view` - Top products
|
|
316
|
+
- `best_sellers_brand_view` - Top brands
|
|
317
|
+
- `competitive_visibility_competitor_view` - Market share
|
|
318
|
+
|
|
319
|
+
## Product Data Types & Formats
|
|
320
|
+
|
|
321
|
+
### Price Object (Merchant API v1)
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"amountMicros": "79990000",
|
|
326
|
+
"currencyCode": "USD"
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
`amountMicros` = price in micros (1 unit = 1,000,000 micros). So $79.99 = `79990000`.
|
|
330
|
+
|
|
331
|
+
### Price Object (Content API v2.1)
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
{
|
|
335
|
+
"value": "79.99",
|
|
336
|
+
"currency": "USD"
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Key Enums
|
|
341
|
+
|
|
342
|
+
**Availability:**
|
|
343
|
+
- `in_stock`, `out_of_stock`, `preorder`, `backorder`
|
|
344
|
+
|
|
345
|
+
**Condition:**
|
|
346
|
+
- `new`, `refurbished`, `used`
|
|
347
|
+
|
|
348
|
+
**Channel:**
|
|
349
|
+
- `ONLINE`, `LOCAL` (Merchant API)
|
|
350
|
+
- `"online"`, `"local"` (Content API)
|
|
351
|
+
|
|
352
|
+
**Age Group:**
|
|
353
|
+
- `newborn`, `infant`, `toddler`, `kids`, `adult`
|
|
354
|
+
|
|
355
|
+
**Gender:**
|
|
356
|
+
- `male`, `female`, `unisex`
|
|
357
|
+
|
|
358
|
+
### Required Product Fields
|
|
359
|
+
|
|
360
|
+
At minimum, every product needs:
|
|
361
|
+
|
|
362
|
+
| Field | Description |
|
|
363
|
+
|-------|-------------|
|
|
364
|
+
| `offerId` | Your unique product identifier |
|
|
365
|
+
| `contentLanguage` | ISO 639-1 language code (e.g., `en`) |
|
|
366
|
+
| `feedLabel` | Target market (e.g., `US`, `GB`) |
|
|
367
|
+
| `title` | Product name (max 150 chars) |
|
|
368
|
+
| `description` | Product description (max 5000 chars) |
|
|
369
|
+
| `link` | Landing page URL |
|
|
370
|
+
| `imageLink` | Primary image URL (min 100x100px, max 64MB) |
|
|
371
|
+
| `availability` | Stock status |
|
|
372
|
+
| `price` | Product price with currency |
|
|
373
|
+
| `channel` | `ONLINE` or `LOCAL` |
|
|
374
|
+
|
|
375
|
+
**Conditionally required:**
|
|
376
|
+
- `brand` - Required for all products except movies, books, musical recordings
|
|
377
|
+
- `gtin` - Required for all products with a known GTIN
|
|
378
|
+
- `condition` - Required if product is used or refurbished
|
|
379
|
+
- `googleProductCategory` - Strongly recommended; required for some categories
|
|
380
|
+
|
|
381
|
+
### Custom Attributes
|
|
382
|
+
|
|
383
|
+
For attributes not covered by typed fields, use custom attributes (max 2500 per product, 102.4KB total):
|
|
384
|
+
|
|
385
|
+
```json
|
|
386
|
+
{
|
|
387
|
+
"customAttributes": [
|
|
388
|
+
{ "name": "warranty_years", "value": "3" },
|
|
389
|
+
{ "name": "compatible_with", "value": "Model X, Model Y" }
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Feed Formats
|
|
395
|
+
|
|
396
|
+
### API (Recommended)
|
|
397
|
+
|
|
398
|
+
Use `productInputs:insert` / `productInputs:patch` for real-time updates.
|
|
399
|
+
|
|
400
|
+
### File-Based Feeds
|
|
401
|
+
|
|
402
|
+
Supported formats for file data sources:
|
|
403
|
+
|
|
404
|
+
**Tab-Separated Values (TSV):**
|
|
405
|
+
```
|
|
406
|
+
id title description link image_link availability price brand gtin condition
|
|
407
|
+
SKU-001 Premium Headphones Noise-cancelling... https://... https://... in stock 79.99 USD AudioBrand 0123456789012 new
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**XML (Atom/RSS):**
|
|
411
|
+
```xml
|
|
412
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
413
|
+
<feed xmlns="http://www.w3.org/2005/Atom"
|
|
414
|
+
xmlns:g="http://base.google.com/ns/1.0">
|
|
415
|
+
<title>Product Feed</title>
|
|
416
|
+
<entry>
|
|
417
|
+
<g:id>SKU-001</g:id>
|
|
418
|
+
<g:title>Premium Headphones</g:title>
|
|
419
|
+
<g:description>Noise-cancelling...</g:description>
|
|
420
|
+
<g:link>https://example.com/headphones</g:link>
|
|
421
|
+
<g:image_link>https://example.com/images/headphones.jpg</g:image_link>
|
|
422
|
+
<g:availability>in stock</g:availability>
|
|
423
|
+
<g:price>79.99 USD</g:price>
|
|
424
|
+
<g:brand>AudioBrand</g:brand>
|
|
425
|
+
<g:gtin>0123456789012</g:gtin>
|
|
426
|
+
<g:condition>new</g:condition>
|
|
427
|
+
</entry>
|
|
428
|
+
</feed>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
File feeds use **snake_case** attribute names (e.g., `image_link`), while the API uses **camelCase** (e.g., `imageLink`).
|
|
432
|
+
|
|
433
|
+
## Data Sources
|
|
434
|
+
|
|
435
|
+
Data sources define how product data flows into Merchant Center:
|
|
436
|
+
|
|
437
|
+
| Type | Description |
|
|
438
|
+
|------|-------------|
|
|
439
|
+
| **Primary API** | Products inserted via API |
|
|
440
|
+
| **Primary File** | Products from file upload (scheduled fetch or direct upload) |
|
|
441
|
+
| **Supplemental API** | Supplements primary with additional attributes via API |
|
|
442
|
+
| **Supplemental File** | Supplements primary with additional attributes via file |
|
|
443
|
+
| **Autofeed** | Google auto-crawls your site for product data |
|
|
444
|
+
|
|
445
|
+
```javascript
|
|
446
|
+
// Create a primary API data source
|
|
447
|
+
const dataSource = {
|
|
448
|
+
displayName: 'My API Feed',
|
|
449
|
+
primaryProductDataSource: {
|
|
450
|
+
channel: 'ONLINE_PRODUCTS',
|
|
451
|
+
contentLanguage: 'en',
|
|
452
|
+
feedLabel: 'US',
|
|
453
|
+
},
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
await fetch(
|
|
457
|
+
`https://merchantapi.googleapis.com/datasources/v1/accounts/${MERCHANT_ID}/dataSources`,
|
|
458
|
+
{
|
|
459
|
+
method: 'POST',
|
|
460
|
+
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
|
|
461
|
+
body: JSON.stringify(dataSource),
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## Migration: Content API to Merchant API
|
|
467
|
+
|
|
468
|
+
Read `references/migration.md` for the full migration guide. Key changes:
|
|
469
|
+
|
|
470
|
+
| Content API | Merchant API |
|
|
471
|
+
|-------------|-------------|
|
|
472
|
+
| `products.insert` | `productInputs:insert` (write) + `products.get` (read) |
|
|
473
|
+
| `products.get` returns mutable data | `products.get` returns processed read-only data |
|
|
474
|
+
| `productstatuses` separate service | Status embedded in `products` resource |
|
|
475
|
+
| `id` format: `channel:lang:country:offerId` | `name` format: `accounts/{id}/products/lang~feedLabel~offerId` |
|
|
476
|
+
| `targetCountry` | `feedLabel` |
|
|
477
|
+
| Top-level attributes | Nested under `productAttributes` |
|
|
478
|
+
| `customBatch` | Async requests / HTTP batching |
|
|
479
|
+
| Price as `{ value, currency }` | Price as `{ amountMicros, currencyCode }` |
|
|
480
|
+
|
|
481
|
+
## Client Libraries
|
|
482
|
+
|
|
483
|
+
Google provides official client libraries:
|
|
484
|
+
|
|
485
|
+
| Language | Package |
|
|
486
|
+
|----------|---------|
|
|
487
|
+
| Node.js | `@google-shopping/products`, `@google-shopping/accounts`, etc. |
|
|
488
|
+
| Python | `google-shopping-merchant-products`, `google-shopping-merchant-accounts`, etc. |
|
|
489
|
+
| Java | `google-shopping-merchant-products`, etc. |
|
|
490
|
+
| PHP | `google/shopping-merchant-products`, etc. |
|
|
491
|
+
|
|
492
|
+
Each sub-API has its own package. Install only what you need.
|
|
493
|
+
|
|
494
|
+
```bash
|
|
495
|
+
# Node.js
|
|
496
|
+
npm install @google-shopping/products @google-shopping/accounts
|
|
497
|
+
|
|
498
|
+
# Python
|
|
499
|
+
pip install google-shopping-merchant-products google-shopping-merchant-accounts
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
## Error Handling
|
|
503
|
+
|
|
504
|
+
The API returns standard Google API error responses:
|
|
505
|
+
|
|
506
|
+
```json
|
|
507
|
+
{
|
|
508
|
+
"error": {
|
|
509
|
+
"code": 400,
|
|
510
|
+
"message": "Request contains an invalid argument.",
|
|
511
|
+
"status": "INVALID_ARGUMENT",
|
|
512
|
+
"details": [
|
|
513
|
+
{
|
|
514
|
+
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
|
|
515
|
+
"reason": "INVALID_PRODUCT_INPUT",
|
|
516
|
+
"metadata": {
|
|
517
|
+
"field": "productAttributes.price"
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Common error codes:
|
|
526
|
+
- `400 INVALID_ARGUMENT` - Bad request data
|
|
527
|
+
- `401 UNAUTHENTICATED` - Missing or invalid credentials
|
|
528
|
+
- `403 PERMISSION_DENIED` - Insufficient access
|
|
529
|
+
- `404 NOT_FOUND` - Resource doesn't exist
|
|
530
|
+
- `429 RESOURCE_EXHAUSTED` - Rate limit exceeded (implement exponential backoff)
|
|
531
|
+
- `409 ALREADY_EXISTS` - Duplicate resource
|
|
532
|
+
|
|
533
|
+
## Quotas and Rate Limits
|
|
534
|
+
|
|
535
|
+
Check your current quota usage:
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
539
|
+
"https://merchantapi.googleapis.com/quota/v1/accounts/$MERCHANT_ID/quotas"
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
General guidelines:
|
|
543
|
+
- Implement **exponential backoff** for `429` errors
|
|
544
|
+
- Use async/parallel requests instead of `customBatch`
|
|
545
|
+
- Monitor quota consumption through the Quota sub-API
|
|
546
|
+
- Spread requests evenly rather than bursting
|
|
547
|
+
|
|
548
|
+
## Notifications (Push Updates)
|
|
549
|
+
|
|
550
|
+
Instead of polling for product changes, subscribe to push notifications:
|
|
551
|
+
|
|
552
|
+
```javascript
|
|
553
|
+
const subscription = {
|
|
554
|
+
registeredEvent: 'PRODUCT_STATUS_CHANGE',
|
|
555
|
+
callBackUri: 'https://your-server.com/merchant-webhook',
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
await fetch(
|
|
559
|
+
`https://merchantapi.googleapis.com/notifications/v1/accounts/${MERCHANT_ID}/notificationsubscriptions`,
|
|
560
|
+
{
|
|
561
|
+
method: 'POST',
|
|
562
|
+
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
|
|
563
|
+
body: JSON.stringify(subscription),
|
|
564
|
+
}
|
|
565
|
+
);
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
## Reference Files
|
|
569
|
+
|
|
570
|
+
For detailed endpoint schemas and examples for each sub-API, consult:
|
|
571
|
+
|
|
572
|
+
- `references/products.md` - ProductInput fields, Products read, product attributes
|
|
573
|
+
- `references/accounts.md` - Account management, shipping, business info, programs, users
|
|
574
|
+
- `references/inventories.md` - Local and regional inventory management
|
|
575
|
+
- `references/datasources.md` - Data source creation and management
|
|
576
|
+
- `references/reports.md` - Report queries, available tables, metrics and segments
|
|
577
|
+
- `references/promotions.md` - Promotion creation and management
|
|
578
|
+
- `references/migration.md` - Content API to Merchant API migration guide
|
|
579
|
+
- `references/content-api-legacy.md` - Content API for Shopping v2.1 reference (for legacy code)
|
|
580
|
+
|
|
581
|
+
Read the relevant reference file when you need detailed field-level documentation for a specific sub-API.
|