> 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/products/cn/web-scraper-api/mu-biao/dian-zi-shang-wu/amazon/ding-jia.md).

# 定价

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

该 `amazon_pricing` source 会获取某个产品的报价列表（ASIN 的所有卖家报价）。配合 `"parse": true` 响应为结构化 JSON（字段说明见 [数据字典](#output-data-dictionary) 如下）；没有它， `content` 保存报价列表的 HTML 片段。

## 请求示例

在下方的代码示例中，我们会发起请求，以获取 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
)

# Instead of response with job status and results url, this will return the
# JSON response with the result.
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
# The whole string you submit has to be URL-encoded.

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 %}

## 请求参数值

{% hint style="info" %}
除了下面列出的参数外，您还可以包含其他参数，例如 `user_agent_type`, `geo_location`, `render`等，以自定义您的抓取请求。阅读更多 [这里](/products/cn/web-scraper-api/features.md).
{% endhint %}

<table><thead><tr><th width="230">参数</th><th>描述</th><th width="130">默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>来源</code></strong></mark></td><td>设置爬虫。</td><td><code>amazon_pricing</code></td></tr><tr><td><mark style="background-color:green;"><strong><code>query</code></strong></mark></td><td>10 位 ASIN 代码。</td><td>-</td></tr><tr><td><code>start_page</code></td><td>起始页码。</td><td>1</td></tr><tr><td><code>pages</code></td><td>要获取的页数。</td><td>1</td></tr><tr><td><code>geo_location</code>, <code>domain</code>, <code>locale</code>, <code>context:currency</code></td><td>本地化参数，参见“本地化和筛选”。</td><td>-</td></tr></tbody></table>

&#x20;   \- 必填参数

## 响应示例

ASIN 的已解析报价列表 `B087TXHLVQ` 在 amazon.nl 上（列表已缩短为 1 项，长值已截断）。

<details>

<summary><code>amazon_pricing</code> 响应示例</summary>

```json
{
    "results": [
        {
            "content": {
                "asin": "B087TXHLVQ",
                "asin_in_url": "B087TXHLVQ",
                "page": 1,
                "parse_status_code": 12000,
                "pricing": [
                    {
                        "condition": "全新",
                        "currency": "EUR",
                        "delivery": "由 Amazon.nl 发货",
                        "delivery_options": [
                            {
                                "date": {
                                    "by": "星期五，9月25日"
                                },
                                "type": "免费配送"
                            },
                            ...
                        ],
                        "max_quantity": 20,
                        "offer_listing_id": "QJEWCmLlHrc8vewZ%2ByKWM0bCGk3Ln2UncErnPwg%2BrHSbF8zEcoFaDTr7ZzJG7L98dR...",
                        "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=B0...",
                        "seller_rating": 5
                    }
                ],
                "review_count": 3559,
                "title": "HOOBRO 边桌，可折叠，沙发端桌，桌板，2 件套，...",
                "url": "https://www.amazon.nl/gp/product/ajax/aodAjaxMain/ref=dp_aod_unknown_m..."
            },
            "created_at": "2026-09-23 08:03:57",
            "updated_at": "2026-09-23 08:03:58",
            "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": "7508435981595350017",
            "status_code": 200,
            "parser_type": ""
        }
    ],
    "job": {...}
}
```

</details>

## 本地化与筛选 <a href="#localization-and-filtering" id="localization-and-filtering"></a>

{% hint style="warning" %}
**重要：** 在大多数页面类型中，Amazon 会根据客户的配送地点定制返回结果。因此，我们建议使用 `geo_location` 参数来设置你偏好的配送地点。你可以阅读更多关于使用 `geo_location` 与 Amazon 搭配使用 [**这里**](/products/cn/web-scraper-api/features/localization/e-commerce-localization.md).
{% endhint %}

<table><thead><tr><th width="180">参数</th><th>描述</th><th width="150">默认值</th></tr></thead><tbody><tr><td><code>geo_location</code></td><td>该 <em>配送至</em> location：市场国家/地区的 ZIP 或邮政编码（例如 <code>10001</code> 在 <code>com</code>）或两个字母的 ISO 国家/地区代码（例如 <code>DE</code>）。不接受国家或城市名称。</td><td>-</td></tr><tr><td><code>domain</code></td><td>要抓取的 Amazon 市场，例如 <code>com</code>, <code>co.uk</code>, <code>de</code>。完整列表见 <a href="/products/cn/web-scraper-api/features/localization/domain-locale.md">域名与区域设置</a>.</td><td><code>com</code></td></tr><tr><td><code>locale</code></td><td>页面的界面语言（<code>Accept-Language</code> 值）。可用值取决于市场；不支持的值会返回 <code>400</code> 并附带可接受列表。完整列表见 <a href="/products/cn/web-scraper-api/features/localization/domain-locale.md">域名与区域设置</a>.</td><td>市场默认值</td></tr><tr><td><code>context:currency</code></td><td>价格显示所用的货币。可用值取决于市场，某些市场（包括 <code>com</code>）仅显示其默认货币。可用值和默认值 <a href="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FNNybEQaVnTrc9ymR1NGE%2Fcurrency_new.json?alt=media&#x26;token=a77440f9-50a5-4e07-9">这里</a>.</td><td>市场默认值</td></tr></tbody></table>

```json
{
    "source": "amazon_pricing",
    "domain": "de",
    "query": "B08Y72CH1F",
    "geo_location": "10115",
    "parse": true
}
```

## 输出数据字典

#### HTML 示例

<figure><img src="https://3714446197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBQ7Zf9paoN3FTeGcyfY1%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>标题</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>评论数</code></td><td>评论总数。</td><td>整数</td></tr><tr><td><code>parse_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>created_at</code></td><td>抓取任务创建时的时间戳。</td><td>timestamp</td></tr><tr><td><code>update_at</code></td><td>抓取任务完成时的时间戳。</td><td>timestamp</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": "由 Amazon.com 发货",
        "condition": "全新",
        "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 width="222.36328125">键（pricing）</th><th width="438.0234375">描述</th><th width="94.02734375">类型</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>商品状况</code></td><td>商品状况。</td><td>字符串</td></tr><tr><td><code>卖家 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><tr><td><code>delivery_options</code> : <code>type</code></td><td>配送选项，例如免费配送。</td><td>字符串</td></tr><tr><td><code>delivery_options</code> : <code>日期</code> : <code>by</code></td><td>此选项承诺的送达日期。</td><td>字符串</td></tr><tr><td><code>max_quantity</code></td><td>可从此报价订购的最大数量。</td><td>整数</td></tr><tr><td><code>offer_listing_id</code></td><td>Amazon 对该报价列表的标识符。</td><td>字符串</td></tr><tr><td><code>seller_rating</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/products/cn/web-scraper-api/mu-biao/dian-zi-shang-wu/amazon/ding-jia.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
