> 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/dian-zi-shang-wu/amazon/url.md).

# URL

该 `amazon` source 的设计用于从各种 Amazon URL 中检索内容。这意味着你无需发送多个参数，只需提供所需 Amazon 页面 的直接 URL 给我们即可。我们不会剥离任何参数，也不会以其他任何方式更改你的 URL。

## 请求示例

在下面的代码示例中，我们发起请求以检索 ASIN 的 Amazon 商品页面 `B08Y6Z944Q`.

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

```shell
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "amazon", 
        "url": "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint


# 结构化负载。
payload = {
    'source': 'amazon',
    'url': 'https://www.amazon.co.uk/dp/B08Y6Z944Q/',
    'parse': True
}

# 获取响应。
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'), #你的凭据填写在这里
    json=payload,
)

# 不返回作业状态和结果 URL 的响应，而是返回
# 返回包含结果的 JSON。
pprint(response.json())
```

{% endtab %}

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

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

const username = "USERNAME";
const password = "PASSWORD";
const body = {
    source: "amazon",
    url: "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
    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&url=https%3A%2F%2Fwww.amazon.co.uk%2Fdp%2FB08Y6Z944Q%2F&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'amazon',
    'url' => 'https://www.amazon.co.uk/dp/B08Y6Z944Q/',
    '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",
		"url":    "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
		"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",
                url = "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
                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");
        jsonObject.put("url", "https://www.amazon.co.uk/dp/B08Y6Z944Q/");
        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", 
    "url": "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
    "parse": true
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>输出示例</summary>

```json
{
    "results": [
        {
            "content": {
                "ads": [
                    {
                        "pos": 1,
                        "asin": "B0CH3JJN66",
                        "type": "organic_also_viewed",
                        "price": 375,
                        "title": "三星 55 英寸 AU7020 UHD HDR 4K 智能电视（2023）- Crystal UHD 4K 智能电视，配备 HDR 画质、Adaptive Sound Lite、PurColour ",
                        "images": [
                            "https://m.media-amazon.com/images/I/71Dxs5msCcL._AC_SS57_.jpg",
                            "https://m.media-amazon.com/images/I/61rH38KyMnL.jpg",
                            "https://m.media-amazon.com/images/I/71xvR9thu1L.jpg"
                        ],
                        "rating": 4.5,
                        "location": "carousel",
                        "price_upper": 375,
                        "reviews_count": 45,
                        "is_prime_eligible": true
                    },
                    {
                        "pos": 2,
                        "asin": "B0BW9RPQPW",
                        "type": "organic_also_viewed",
                        "price": 362,
                        "title": "50 英寸 CU7110 UHD HDR 智能电视（2023）- 4K Crystal Processor、Adaptive Sound Audio、PurColour、内置游戏 TV Hub、Strea",
                        "images": [
                            "https://m.media-amazon.com/images/I/81eKwOlfhTL._AC_SS57_.jpg",
                            "https://m.media-amazon.com/images/I/619tbh+PSSL.jpg",
                            "https://m.media-amazon.com/images/I/81iuMoHZWhL.jpg"
                        ],
                        "rating": 4.5,
                        "location": "carousel",
                        "price_upper": 362,
                        "reviews_count": 45,
                        "is_prime_eligible": true
                    },
                    {...}
                ],
                "url": "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
                "asin": "B08Y6Z944Q",
                "page": 1,
                "brand": "Samsung",
                "price": 0,
                "stock": "",
                "title": "三星 AU7100 50 英寸（2021）\u00e2\u20ac\u201c Crystal 4K 智能电视，配备 HDR10+ 画质、Adaptive Sound、Motion Xcelerator 画面、Samsung Q-Symphony 音频和游戏模式 - UE50AU7100KXXU",
                "coupon": "",
                "images": [
                    "https://m.media-amazon.com/images/I/71Urp17dnYL._AC_SL1500_.jpg",
                    ...
                    "https://m.media-amazon.com/images/I/51yb9wscZTL._AC_SL1500_.jpg"
                ],
                "rating": 4.5,
                "category": [
                    {
                        "ladder": [
                            {
                                "url": "/tv-bluray-dvd-home-cinema/b/ref=dp_bc_aui_C_1?ie=UTF8&node=560858",
                                "name": "家庭影院、电视与视频"
                            },
                            {
                                "url": "/LED-Smart-4K-TVs/b/ref=dp_bc_aui_C_2?ie=UTF8&node=560864",
                                "name": "电视"
                            }
                        ]
                    }
                ],
                "currency": "GBP",
                "delivery": [],
                "_warnings": [
                    "无法解析价格数量。",
                    "无法解析价格。",
                    "无法解析描述。"
                ],
                "page_type": "产品",
                "price_sns": 0,
                "variation": [
                    {
                        "asin": "B08Y7182XL",
                        "selected": false,
                        "dimensions": {
                            "Size Name": "85\""
                        }
                    },
                    {
                        "asin": "B08Y733RV1",
                        "selected": false,
                        "dimensions": {
                            "Size Name": "43\""
                        }
                    },
                    {...}
                ],
                "has_videos": true,
                "sales_rank": [
                    {
                        "rank": 28405,
                        "ladder": [
                            {
                                "url": "/gp/bestsellers/electronics/ref=pd_zg_ts_electronics",
                                "name": "电子产品与摄影"
                            }
                        ]
                    },
                    {
                        "rank": 479,
                        "ladder": [
                            {
                                "url": "/gp/bestsellers/electronics/560864/ref=pd_zg_hrsr_electronics",
                                "name": "电视"
                            }
                        ]
                    }
                ],
                "top_review": "这款电视以这个价格来说非常出色，画质惊艳，尤其是在流媒体服务上，而这也是我们大多数时候观看的内容。我先在网上阅读了大量专业评测，它们都给出了很高评价，我也没有失望。需要进行不少设置，我还得调整一些选项才能得到最佳画面。起初画面太暗，尤其是在 Amazon Prime 上。看来这在 Prime 上是个特定问题。关闭 \"Brightness Optimisation\" 后，我得到了好得多的画面。我们也不喜欢 4K LED 电视带来的 \"ultra real\" 效果。切换到 \"Filmmaker Mode\" 后就解决了。音质还可以，不过我们本来就使用 soundbar。我尤其喜欢电视附带的两个遥控器。一个是传统遥控器，按键很多：我最初用它完成了所有设置，包括控制 BluRay 播放器和 soundbar。等一切都正常工作后，我换成了更小的遥控器，它只有最基本的按键，但外观和手感更精致，按键的 \"click\" 感也比大号遥控器更好。观看地面数字电视也没问题，不过不如流媒体服务那么好。我们不是玩家，所以无法评价游戏表现。总之，这是一台很棒的电视，而且物超所值。\n  \n阅读更多",
                "asin_in_url": "B08Y6Z944Q",
                "description": "",
                "parent_asin": "B09DLFS6JN",
                "price_upper": 0,
                "pricing_str": "",
                "pricing_url": "https://www.amazon.co.uk/gp/offer-listing/B08Y6Z944Q?startIndex=0",
                "manufacturer": "Samsung",
                "price_buybox": -1,
                "product_name": "三星 AU7100 50 英寸（2021）\u00e2\u20ac\u201c Crystal 4K 智能电视，配备 HDR10+ 画质、Adaptive Sound、Motion Xcelerator 画面、Samsung Q-Symphony 音频和游戏模式 - UE50AU7100KXXU",
                "bullet_points": "AU7100 带来卓越家庭娱乐体验 – 一款智能超高清电视，集多种功能于一身。三星 50 英寸 AU7100 智能电视融合惊艳画质、鲜艳色彩、清晰音频和醒目的超薄贴合设计，提升你的生活空间。\n凭借惊艳 4K 获得强劲画面 – 你的 50 英寸智能电视配备 Dynamic Crystal Colour 和 Contrast Enhancer，因此你可以以惊艳的 4K 细节观看所有喜爱的节目，色彩更鲜明，对比度带来更清晰的画面。\n在电视上通过 Adaptive Sound 体验完美音频——你的三星电视会根据屏幕内容在每个场景中自动调整声音，让你仿佛置身其中。添加三星 soundbar 后，Q-Symphony 可带来影院级体验。\n升级你的办公设置，或用三星电视投入游戏——PC on TV 让你可以通过 Smart TV 远程访问办公室电脑，让你在客厅就能完成一切。我们的 Smart TV 还提供沉浸式游戏模式。\n开始体验三星电视——我们相信电视不仅仅是用来观看的。它应该激发你、震撼你、包围你并让你沉浸其中。从高品质画面到优雅设计，我们的电视不断突破可能性的边界，也不断拓展电视的定义。",
                "price_initial": 0,
                "pricing_count": 1,
                "reviews_count": 2067,
                "sns_discounts": [],
                "developer_info": [],
                "price_shipping": 0,
                "product_details": {
                    "asin": "B08Y6Z944Q",
                    "batteries": "需要 2 节 AAA 电池。（已包含）",
                    "manufacturer": "Samsung",
                    "item_model_number": "UE50AU7100KXXU",
                    "product_dimensions": "5.99 x 111.68 x 64.42 cm; 11.4 kg",
                    "date_first_available": "2021年3月2日"
                },
                "featured_merchant": [],
                "is_prime_eligible": false,
                "parse_status_code": 12005,
                "product_dimensions": "5.99 x 111.68 x 64.42 cm; 11.4 kg",
                "answered_questions_count": 0,
                "rating_stars_distribution": [
                    {
                        "rating": 5,
                        "percentage": 74
                    },
                    {
                        "rating": 4,
                        "percentage": 15
                    },
                    {...}
                ]
            },
            "created_at": "2024-07-01 10:35:28",
            "updated_at": "2024-07-01 10:35:32",
            "page": 1,
            "url": "https://www.amazon.co.uk/dp/B08Y6Z944Q/",
            "job_id": "7213490386797350913",
            "status_code": 200,
            "parser_type": ""
        }
    ]
}
```

</details>

我们使用同步的 [**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) 部分。

## 请求参数值

### 通用

Google URL 爬取的基础设置和自定义选项。

<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</code></td></tr><tr><td><mark style="background-color:green;"><strong>url</strong></mark></td><td>到 Amazon 页面 的直接 URL（链接）</td><td>-</td></tr><tr><td><code>render</code></td><td>设置为 <code>html</code>. <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/9d7133837001de31de5dfd0796cfbc6fdd7c78c8#javascript-rendering"><strong>更多信息</strong></a><strong>.</strong></td><td>-</td></tr><tr><td><code>parse</code></td><td>设置为 <code>true</code><strong>.</strong> 仅限于特定类型的 URL <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/0c3e507c4698b170bfbc4b7626d0ac92df840637"><strong>Amazon 页面类型</strong></a>.</td><td><code>false</code></td></tr><tr><td><code>callback_url</code></td><td>您的回调端点 URL。 <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/f93fe40aed5366f8033cd2ebfae30e61c16a4f51"><strong>更多信息</strong></a>.</td><td>-</td></tr><tr><td><code>user_agent_type</code></td><td>设备类型和浏览器。完整列表可在 <a href="/spaces/ZwEHB9k4MH4pDy80n9mF/pages/3e6a8ee6a2915a55b276cc31a20735fe1e0e4ed1"><strong>这里</strong></a>.</td><td><code>desktop</code></td></tr></tbody></table>

&#x20;   \- 必填参数

### 本地化

根据特定地理位置和语言调整结果。

| 参数             | 说明                                                                                                                                               | 默认值 |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | --- |
| `geo_location` | 该 *送达至* 位置。请参阅我们关于使用此参数的指南 [**这里**](/products/cn/web-scraper-api/features/localization/proxy-location.md#list-of-supported-geo_location-values). | -   |
| `locale`       | `Accept-Language` 标头值，用于设置 Amazon 页面界面语言。 [**更多信息**](/products/cn/web-scraper-api/features/localization/domain-locale.md#amazon).                | -   |

{% hint style="warning" %}
**重要：** 在大多数页面类型中，Amazon 会根据客户的配送地点来定制返回结果。因此，我们建议使用 `geo_location` 参数来设置您首选的配送地点。您可以阅读更多关于在 Amazon 中使用 `geo_location` 的内容 [**这里**](broken://pages/8931e43529976f20d349248bd18bb7ad8c63a051).
{% endhint %}

### 其他

适用于专门需求的其他高级设置和控制项。

| 参数                                              | 说明                                                                                                                                                                                                                         | 默认值                                                                                                                                                                                                                         |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>context</code>:<br><code>货币</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). |


---

# 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/dian-zi-shang-wu/amazon/url.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.
