> 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/e-commerce/amazon/pricing.md).

# 定价

使用网页爬虫API 访问 Amazon 产品定价数据。通过现成示例和参数获取价格列表、折扣和优惠。

该 `amazon_pricing` 数据源旨在检索 Amazon 商品报价列表。要查看解析后的输出是什么样子，请下载 [**此**](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiwDdoZGfMbUe5cRL2417%2Fuploads%2FhGVtkmLp7gccwTLCJzLY%2Famazon_pricing.json?alt=media\&token=a30a8253-225f-44c2-880b-850e94e23c21) JSON 文件。

{% hint style="info" %}
查看输出 [**数据字典**](#data-dictionary) 用于 Amazon Pricing，提供简要说明、截图、解析后的 JSON 代码片段以及定义每个解析字段的表格。你可以使用右侧导航或向下滚动页面浏览详情。
{% endhint %}

## 请求示例

在下面的代码示例中，我们会请求检索 ASIN B087TXHLVQ 在 `amazon.nl` 市场。

{% tabs %}
{% tab title="cURL" %}

```shell
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "amazon_pricing",
        "domain": "nl",
        "query": "B087TXHLVQ",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint


# Structure payload.
payload = {
    'source': 'amazon_pricing',
    'domain': 'nl',
    'query': 'B087TXHLVQ',
    'parse': True,
}


# Get response.
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'),
    json=payload,
)

# Print prettified response to stdout.
pprint(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const https = require("https");

const username = "USERNAME";
const password = "PASSWORD";
const body = {
    source: "amazon_pricing",
    domain: "nl",
    query: "B087TXHLVQ",
    parse: true,
};

const options = {
    hostname: "realtime.oxylabs.io",
    path: "/v1/queries",
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        Authorization:
            "Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
    },
};

const request = https.request(options, (response) => {
    let data = "";

    response.on("data", (chunk) => {
        data += chunk;
    });

    response.on("end", () => {
        const responseData = JSON.parse(data);
        console.log(JSON.stringify(responseData, null, 2));
    });
});

request.on("error", (error) => {
    console.error("Error:", error);
});

request.write(JSON.stringify(body));
request.end();
```

{% endtab %}

{% tab title="HTTP" %}

```http
https://realtime.oxylabs.io/v1/queries?source=amazon_pricing&domain=nl&query=B087TXHLVQ&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'amazon_pricing',
    'domain' => 'nl',
    'query' => 'B087TXHLVQ',
    'parse' => true
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");

$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	const Username = "USERNAME"
	const Password = "PASSWORD"

	payload := map[string]interface{}{
		"source": "amazon_pricing",
		"domain": "nl",
		"query":  "B087TXHLVQ",
		"parse":  true,
	}

	jsonValue, _ := json.Marshal(payload)

	client := &http.Client{}
	request, _ := http.NewRequest("POST",
		"https://realtime.oxylabs.io/v1/queries",
		bytes.NewBuffer(jsonValue),
	)

	request.SetBasicAuth(Username, Password)
	response, _ := client.Do(request)

	responseText, _ := ioutil.ReadAll(response.Body)
	fmt.Println(string(responseText))
}

```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;

namespace OxyApi
{
    class Program
    {
        static async Task Main()
        {
            const string Username = "USERNAME";
            const string Password = "PASSWORD";

            var parameters = new {
                source = "amazon_pricing",
                domain = "nl",
                query = "B087TXHLVQ",
                parse = true
            };

            var client = new HttpClient();

            Uri baseUri = new Uri("https://realtime.oxylabs.io");
            client.BaseAddress = baseUri;

            var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
            requestMessage.Content = JsonContent.Create(parameters);

            var authenticationString = $"{Username}:{Password}";
            var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
            requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);

            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();

            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;

import okhttp3.*;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;

public class Main implements Runnable {
    private static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String USERNAME = "USERNAME";
    public static final String PASSWORD = "PASSWORD";

    public void run() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("source", "amazon_pricing");
        jsonObject.put("domain", "nl");
        jsonObject.put("query", "B087TXHLVQ");
        jsonObject.put("parse", true);

        Authenticator authenticator = (route, response) -> {
            String credential = Credentials.basic(USERNAME, PASSWORD);
            return response
                    .request()
                    .newBuilder()
                    .header(AUTHORIZATION_HEADER, credential)
                    .build();
        };

        var client = new OkHttpClient.Builder()
                .authenticator(authenticator)
                .readTimeout(180, TimeUnit.SECONDS)
                .build();

        var mediaType = MediaType.parse("application/json; charset=utf-8");
        var body = RequestBody.create(jsonObject.toString(), mediaType);
        var request = new Request.Builder()
                .url("https://realtime.oxylabs.io/v1/queries")
                .post(body)
                .build();

        try (var response = client.newCall(request).execute()) {
            if (response.body() != null) {
                try (var responseBody = response.body()) {
                    System.out.println(responseBody.string());
                }
            }
        } catch (Exception exception) {
            System.out.println("Error: " + exception.getMessage());
        }

        System.exit(0);
    }

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
    "source": "amazon_pricing", 
    "domain": "nl", 
    "query": "B087TXHLVQ",
    "parse": true
}
```

{% endtab %}
{% endtabs %}

我们在示例中使用同步 [**Realtime**](/products/cn/web-scraper-api/integration-methods/realtime.md) 集成方法。如果你想使用 [**Proxy Endpoint**](/products/cn/web-scraper-api/integration-methods/proxy-endpoint.md) 或异步 [**Push-Pull**](/products/cn/web-scraper-api/integration-methods/push-pull.md) 集成，请参阅 [**集成方法**](/products/cn/web-scraper-api/integration-methods.md) 部分。

## 请求参数值

### 通用

用于抓取 Amazon 商品报价列表的基本设置和自定义选项。

<table><thead><tr><th width="222">参数</th><th width="350.3333333333333">描述</th><th>默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong>source</strong></mark></td><td>设置爬虫。</td><td><code>amazon_pricing</code></td></tr><tr><td><mark style="background-color:green;"><strong>query</strong></mark></td><td>10 位 ASIN 代码</td><td>-</td></tr><tr><td><code>render</code></td><td>设置为时启用 JavaScript 渲染 <code>html</code>. <a href="/products/cn/web-scraper-api/features/js-rendering-and-browser-control.md#javascript-rendering"><strong>更多信息</strong></a><strong>.</strong></td><td>-</td></tr><tr><td><code>parse</code></td><td>设置为时返回解析后的数据 <code>true</code>。查看输出 <a href="#output-data-dictionary"><strong>数据字典</strong></a>.</td><td><code>false</code></td></tr><tr><td><code>callback_url</code></td><td>指向你的回调端点的 URL。 <a href="/products/cn/web-scraper-api/integration-methods/push-pull.md"><strong>更多信息</strong></a>..</td><td>-</td></tr><tr><td><code>user_agent_type</code></td><td>设备类型和浏览器。完整列表可见 <a href="/products/cn/web-scraper-api/features/http-context-and-job-management/user-agent-type.md"><strong>此处</strong></a>.</td><td><code>桌面端</code></td></tr></tbody></table>

\- 必填参数

### 本地化

将结果适配到特定地理位置、域名和语言。

| 参数             | 描述                                                                                                                                                                              | 默认值   |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| `geo_location` | 该 *配送到* 位置。请参阅我们使用此参数的指南 [**此处**](/products/cn/web-scraper-api/features/localization/proxy-location.md#list-of-supported-geo_location-values).                                  | -     |
| `domain`       | Amazon 的域名本地化。可用域名的完整列表可见 [**此处**](https://github.com/oxylabs/gitbook-public-english/blob/master/scraping-solutions/web-scraper-api/targets/amazon/broken-reference/README.md). | `com` |
| `locale`       | `Accept-Language` 标头值，用于设置 Amazon 页面界面语言。 [**更多信息**](/products/cn/web-scraper-api/features/localization/domain-locale.md#amazon).                                               | -     |

{% hint style="warning" %}
**重要：** 在大多数页面类型中，Amazon 会根据客户的配送位置调整返回结果。因此，我们建议使用 `geo_location` 参数来设置你偏好的配送位置。你可以阅读更多关于使用 `geo_location` 与 Amazon 搭配使用 [**此处**](broken://pages/8931e43529976f20d349248bd18bb7ad8c63a051).
{% endhint %}

### 分页

用于管理搜索结果分页和检索的控制项。

<table><thead><tr><th width="222">参数</th><th width="350.3333333333333">描述</th><th width="167">默认值</th></tr></thead><tbody><tr><td><code>start_page</code></td><td>起始页码。</td><td><code>1</code></td></tr><tr><td><code>pages</code></td><td>要检索的页数。</td><td><code>1</code></td></tr></tbody></table>

### 其他

针对特殊需求的额外高级设置和控制项。

| 参数                                                    | 描述                                                                                                                                                                                                                          | 默认值                                                                                                                                                                                                                          |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>context</code>:<br><code>currency</code></p> | 设置货币。请查看可用值 [**此处**](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FNNybEQaVnTrc9ymR1NGE%2Fcurrency_new.json?alt=media\&token=a77440f9-50a5-4e07-9993-b2db2144800b). | 取决于市场。请查看默认值 [**此处**](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FNNybEQaVnTrc9ymR1NGE%2Fcurrency_new.json?alt=media\&token=a77440f9-50a5-4e07-9993-b2db2144800b). |

#### 代码示例

```json
{
    "source": "amazon_pricing",
    "domain": "nl",
    "query": "B087TXHLVQ",
    "parse": true,
    "context": [
        {
            "key": "currency",
            "value": "AUD"
        }
    ]
}
```

## 结构化数据

<details>

<summary><code>amazon_pricing</code> 结构化输出</summary>

```json
{
    "results": [
        {
            "content": {
                "asin": "B087TXHLVQ",
                "asin_in_url": "B087TXHLVQ",
                "page": 1,
                "parse_status_code": 12000,
                "pricing": [
                    {
                        "condition": "Nieuw",
                        "currency": "EUR",
                        "delivery": "Verzonden vanuit Amazon.nl",
                        "delivery_options": [
                            {
                                "date": {
                                    "by": "zaterdag, 19 september"
                                },
                                "type": "GRATIS bezorging"
                            }
                        ],
                        "max_quantity": 20,
                        "offer_listing_id": "cXMReC0EfjT5WbfKNnK6NVz3IwOT8ATjlmM2zXdW2qTHP8OEpDZ%2FhQC30MWy%2BDoXNz58hPde5fjeL3%2BaeNZRTEbVhQZJxE1zbEcjD3RfAaqotH%2BdYEb5n4mb7P0iJvGJOz%2B%2B7KqWzrEDn2VDPMNHJw4f7mkfoMrCE33sonKmUh3POnUQYQfUKF0z1GzCbpau",
                        "price": 33.99,
                        "price_shipping": 0,
                        "rating_count": 29,
                        "seller": "HOOBRO NL",
                        "seller_id": "A10KKLR252QEUP",
                        "seller_link": "/gp/aag/main?ie=UTF8&seller=A10KKLR252QEUP&isAmazonFulfilled=1&asin=B087TXHLVQ&ref_=olp_merch_name_0",
                        "seller_rating": 5
                    }
                ],
                "review_count": 3557,
                "title": "HOOBRO Bijzettafel, opvouwbaar, bankuiteinde, tafelbladen, set van 2, nachtkastjes, industriële stijl, woonkamer, rustiek bruin EBF25BZ01",
                "url": "https://www.amazon.nl/gp/product/ajax/aodAjaxMain/ref=dp_aod_unknown_mbc?asin=B087TXHLVQ&pageno=1&language=nl_NL"
            },
            "created_at": "2026-09-17 13:55:53",
            "updated_at": "2026-09-17 13:55:54",
            "page": 1,
            "url": "https://www.amazon.nl/gp/product/ajax/aodAjaxMain/ref=dp_aod_unknown_mbc?asin=B087TXHLVQ&pageno=1&language=nl_NL",
            "job_id": "7506350218028291075",
            "is_render_forced": false,
            "status_code": 200,
            "parser_type": "",
            "parser_preset": null
        }
    ]
}
```

</details>

## 输出数据字典

#### HTML 示例

<figure><img src="https://1830353461-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBaJCXoqO1zdFnaMnCKrg%2Fuploads%2Fgit-blob-747a792334164f4c28cad93528e56efbe7b430ed%2Famazon_pricing.png?alt=media" alt=""><figcaption></figcaption></figure>

该 `amazon_pricing` 提供 Amazon 上特定产品的定价信息结构化表示。下表列出了我们解析的每个字段的详细信息，以及对应的描述和数据类型。表中还包含一些元数据。

#### JSON 结构

<table><thead><tr><th width="221">键</th><th width="328">描述</th><th>类型</th></tr></thead><tbody><tr><td><code>url</code></td><td>Amazon 产品页面的 URL。</td><td>字符串</td></tr><tr><td><code>asin</code></td><td>Amazon 标准识别号。</td><td>字符串</td></tr><tr><td><code>page</code></td><td>当前页码。</td><td>整数</td></tr><tr><td><code>title</code></td><td>商品标题。</td><td>字符串</td></tr><tr><td><code>pricing</code></td><td>定价详情列表。</td><td>数组</td></tr><tr><td><code>asin_in_url</code></td><td>从 URL 中检索到的 Amazon 标准识别号。</td><td>字符串</td></tr><tr><td><code>review_count</code></td><td>评论总数。</td><td>整数</td></tr><tr><td><code>parse_status_code</code></td><td>解析任务的状态代码。你可以查看所描述的解析器状态代码。 <a href="https://github.com/oxylabs/gitbook-public-english/blob/master/scraping-solutions/web-scraper-api/targets/amazon/broken-reference/README.md"><strong>此处</strong></a>.</td><td>整数</td></tr><tr><td><code>created_at</code></td><td>创建抓取任务时的时间戳。</td><td>时间戳</td></tr><tr><td><code>update_at</code></td><td>抓取任务完成时的时间戳。</td><td>时间戳</td></tr><tr><td><code>job_id</code></td><td>与抓取任务关联的作业 ID。</td><td>字符串</td></tr><tr><td><code>status_code</code></td><td>抓取任务的状态代码。你可以查看所描述的抓取器状态代码。 <a href="/products/cn/web-scraper-api/response-codes.md"><strong>此处</strong></a>.</td><td>整数</td></tr><tr><td><code>parser_type</code></td><td>用于解析数据的解析器类型。</td><td>字符串</td></tr></tbody></table>

{% hint style="info" %}
在以下各节中，当结果类型可用多个项目时，解析后的 JSON 代码片段会被缩短。
{% endhint %}

### 定价

`pricing` 包括价格、卖家、货币、配送选项、产品状况、卖家 ID 以及卖家页面链接等详细信息。此外，还可能提供卖家收到的评分数量以提供更多上下文。

<figure><img src="https://lh7-us.googleusercontent.com/Llj-o9YYWOEDj_93awsp5EBVn5U2Sbc69qLEQApZ1pX8uhjwTHVEovOaiP9Lc2N2kT3x98SIfba1L0i1RoR5m9QKEdZ_Go8UQzxiT8drYS1St4HYIltrSRNAcXo2jOdZXJRhiqFjwnSp7coFtrq3X60" alt=""><figcaption></figcaption></figure>

```json
...
"pricing": [
    {
        "price": 24,
        "seller": "Amazon.com",
        "currency": "USD",
        "delivery": "Ships from Amazon.com",
        "condition": "New",
        "seller_id": "A2NDNAPHQ3UDKH",
        "seller_link": "/gp/aag/main?ie=UTF8&seller=A2NDNAPHQ3UDKH&isAmazonFulfilled=0&asin=B07H9DVLBB&ref_=olp_merch_name_0",
        "rating_count": 41715,
        "price_shipping": 0,
        "delivery_options": []
    },
...
```

<table><thead><tr><th>键（定价）</th><th width="238">描述</th><th>类型</th></tr></thead><tbody><tr><td><code>price</code></td><td>产品价格。</td><td>浮点数</td></tr><tr><td><code>seller</code></td><td>产品卖家。</td><td>字符串</td></tr><tr><td><code>currency</code></td><td>价格所使用的货币。</td><td>字符串</td></tr><tr><td><code>delivery</code></td><td>产品的发货地点。</td><td>字符串</td></tr><tr><td><code>condition</code></td><td>产品状况。</td><td>字符串</td></tr><tr><td><code>seller_id</code></td><td>Amazon 卖家的标识。</td><td>字符串</td></tr><tr><td><code>seller_link</code></td><td>Amazon 卖家页面的 URL。</td><td>字符串</td></tr><tr><td><code>rating_count</code></td><td>针对该 Amazon 产品提交的评分总数。</td><td>整数</td></tr><tr><td><code>price_shipping</code></td><td>运费。</td><td>浮点数</td></tr><tr><td><code>delivery_options</code></td><td>标识可用的配送选项。</td><td>数组</td></tr></tbody></table>


---

# 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/e-commerce/amazon/pricing.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.
