> 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 数据源旨在通过 `google_shopping_search` 和 `google_shopping_product` 分别对应这些数据源。下方展示的是一个两步的数据提取流程。

### **步骤 1：生成令牌**

首先，你需要向 `google_shopping_search` [数据源](/api-targets/cn/sou-suo-yin-qing/google/shopping/shopping-search.md)提交请求。此步骤至关重要，因为它会生成 **商品令牌**，这是后续收集商品数据所必需的。下面是 `google_shopping_search` 请求：

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

{% hint style="warning" %}
**重要：** 只有已渲染且已解析的任务才会返回商品令牌。
{% endhint %}

任务完成后，你会在响应中的 `自然结果` 部分：

```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": "grid",
                            "price": 899,
                            "title": "Google Pixel 9 Pro XL",
                            "token": "eyJjYXRhbG9naWQiOiAiNTQ3MTYzMDM1OTkyMzE4MTcyIiwgImdwY2lkIjogIjQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAiaW1hZ2VEb2NpZCI6ICIxMjMwMTAyNDkzMzk0Mjg2MjY4IiwgIm1pZCI6ICI1NzY0NjI3ODc4NTM5Njc1NDAiLCAicHZvIjogIjIzIiwgInB2dCI6ICJoZyIsICJyZHMiOiAiUENfNDQyNjAwODYwNjUwMjA1Nzg1OXxQUk9EX1BDXzQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAicXVlcnkiOiAiZ29vZ2xlX3BpeGVsIn0=",
```

解析结果中收集到的每个商品令牌都代表一个自然结果。

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

### **步骤 2：在商品请求中使用令牌**

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

```json

{
  "source": "google_shopping_product",
  "query": "eyJjYXRhbG9naWQiOiAiNTQ3MTYzMDM1OTkyMzE4MTcyIiwgImdwY2lkIjogIjQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAiaW1hZ2VEb2NpZCI6ICIxMjMwMTAyNDkzMzk0Mjg2MjY4IiwgIm1pZCI6ICI1NzY0NjI3ODc4NTM5Njc1NDAiLCAicHZvIjogIjIzIiwgInB2dCI6ICJoZyIsICJyZHMiOiAiUENfNDQyNjAwODYwNjUwMjA1Nzg1OXxQUk9EX1BDXzQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAicXVlcnkiOiAiZ29vZ2xlX3BpeGVsIn0=",
  "parse": true
}
```

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

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


---

# 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
