> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/api-targets/cn/sou-suo-yin-qing/google/shopping.md).

# 购物

Google Shopping sources 旨在通过收集 SERP 和商品列表数据 `google_shopping_search` 和 `google_shopping_product` 分别通过这些 sources。数据提取是一个两步流程，如下所示。

### **步骤 1：生成 Token**

首先，你需要向 `google_shopping_search` [source](/api-targets/cn/sou-suo-yin-qing/google/shopping/shopping-search.md)提交请求。此步骤至关重要，因为它会生成 **product token**，后续收集商品数据时需要用到它。下面是一个用于 `google_shopping_search` 请求的基础 JSON 负载：

```json
{
  "source": "google_shopping_search",
  "query": "google_pixel",
  "render": "html",
  "parse": true
}
```

{% hint style="warning" %}
**重要：** 只有已渲染并解析的 jobs 才会返回 product tokens。
{% endhint %}

作业完成后，你会在响应中的 `organic` 部分找到该 token：

```json
{
    "results": [
        {
            "content": {
                "url": "https://www.google.com/search?q=google_pixel&gl=us&hl=en&udm=28&sei=1uDkaLnMNPCNxc8P67XmqQg",
                "page": 1,
                "results": {
                    "paid": [],
                    "organic": [
                        {
                            "pos": 1,
                            "url": "https://www.google.com/shopping/product/547163035992318172?q=google_pixel&gl=us&hl=en&udm=28&sei=1uDkaLnMNPCNxc8P67XmqQg&gl=US",
                            "type": "网格",
                            "price": 899,
                            "title": "Google Pixel 9 Pro XL",
                            "token": "eyJjYXRhbG9naWQiOiAiNTQ3MTYzMDM1OTkyMzE4MTcyIiwgImdwY2lkIjogIjQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAiaW1hZ2VEb2NpZCI6ICIxMjMwMTAyNDkzMzk0Mjg2MjY4IiwgIm1pZCI6ICI1NzY0NjI3ODc4NTM5Njc1NDAiLCAicHZvIjogIjIzIiwgInB2dCI6ICJoZyIsICJyZHMiOiAiUENfNDQyNjAwODYwNjUwMjA1Nzg1OXxQUk9EX1BDXzQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAicXVlcnkiOiAiZ29vZ2xlX3BpeGVsIn0=",
```

解析结果中的每个已收集 product token 都代表一个 organic 结果。

{% hint style="info" %}
**注意：** 没有生成的 token，就无法检索商品或价格信息。
{% endhint %}

### **步骤 2：在 Product 请求中使用 Token**

要开始收集商品数据，请在你向 `google_shopping_product` [source](/api-targets/cn/sou-suo-yin-qing/google/shopping/shopping-product.md):

```json

{
  "source": "google_shopping_product",
  发送请求时使用生成的 token：
  "parse": true
}
```

{% hint style="warning" %}
**重要：** 如果使用无效或生成错误的 token，作业将失败。
{% endhint %}

在为 `google_shopping_product` 和 `google_shopping_search` sources 使用本地化参数时，请确保使用相同的 locales（如果未定义则为 none）。sources 之间的区域不一致可能会导致数据不完整或不准确。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/api-targets/cn/sou-suo-yin-qing/google/shopping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
