> 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/etsy/product.md).

# 产品

通过产品 ID 提取 Etsy 产品页面数据，包括价格、图片、卖家详情、评论、配送、类别等。

该 `etsy_product` 该数据源旨在检索 Etsy 商品结果页。我们可以返回你需要的任何 Etsy 页面 HTML。此外，我们还可以提供 **Etsy 商品页面的结构化（解析后）输出**.

## 请求示例

下面的示例说明了如何获取解析后的 Best Buy 商品结果。

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

```shell
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "etsy_product", 
        "product_id": "1858266469",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint


# 构造负载。
payload = {
    'source': 'etsy_product',
    'product_id': '1858266469',
    '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: "etsy_product",
    product_id: "1858266469",
    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
# 你提交的整个字符串必须进行 URL 编码。

https://realtime.oxylabs.io/v1/queries?source=etsy_product&product_id=18582664691&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'etsy_product',
    'product_id' => '1858266469',
    '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="Go 语言" %}

```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":       "etsy_product",
		"product_id":   "1858266469",
		"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 = "etsy_product",
                product_id = "1858266469",
                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", "etsy_product");
        jsonObject.put("product_id", "1858266469");
        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": "etsy_product", 
    "product_id": "1858266469", 
    "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) 部分。

## 请求参数值

### 通用

<table><thead><tr><th width="205">参数</th><th width="289.3333333333333">描述</th><th>默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong>source</strong></mark></td><td>设置爬虫。</td><td><code>etsy_product</code></td></tr><tr><td><mark style="background-color:green;"><strong>product_id</strong></mark></td><td>10 位商品 ID。</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>desktop</code></td></tr></tbody></table>

\- 必填参数

## 结构化数据

`etsy_product` 该数据源可从 Etsy 商品结果中提取 HTML 或 JSON 格式的数据，并为页面的各个元素提供结构化数据。

#### 输出示例

```json
{
    "results": [
        {
            "content": {
                "avg_price": 37.33,
                "categories": [
                    {
                        "title": "Homepage"
                    },
                    ...
                ],
                "currency": "USD",
                "customized": false,
                "images": [
                    "https://i.etsystatic.com/55594479/r/il/8c24e4/6566024892/il_75x75.6566024892_rdzf.jpg",
                    ...
                ],
                "max_price": 40,
                "min_price": 32,
                "old_price": 40,
                "parse_status_code": 12000,
                "price": 32,
                "product_id": "1858266469",
                "seller": {
                    "best_seller": false,
                    "rating": 4.71,
                    "star_seller": false,
                    "title": "Divanjewelrygold",
                    "url": "https://www.etsy.com/shop/Divanjewelrygold?ref=shop-header-name&listing_id=1858266469&from_page=listing"
                },
                "shipping": {
                    "from": "North Bergen, NJ"
                },
                "title": "Freshwater Pearl Drop Earrings,Bridal Pearl Earrings,18K Gold Dangle Earrings,Wedding Earrings,Bridesmaid Gift,Wedding Gift,Bridal Jewelry",
                "url": "https://www.etsy.com/listing/1858266469/freshwater-pearl-drop-earringsbridal",
                "variation_count": 3
            },
            "created_at": "2026-09-18 06:53:34",
            "updated_at": "2026-09-18 06:53:43",
            "page": 1,
            "url": "https://www.etsy.com/listing/1858266469/freshwater-pearl-drop-earringsbridal",
            "job_id": "7506606326152213505",
            "is_render_forced": true,
            "status_code": 200,
            "parser_type": "etsy_product",
            "parser_preset": null
        }
    ]
}
```

## 输出数据字典

#### HTML 示例

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

#### JSON 结构

下表列出了我们解析的每个商品页面元素的详细列表，以及其描述和数据类型。表中还包含一些元数据。

<table><thead><tr><th>键</th><th width="289">描述</th><th>类型</th></tr></thead><tbody><tr><td><code>url</code></td><td>Etsy 商品页面的 URL。</td><td>字符串</td></tr><tr><td><code>price</code></td><td>商品价格。</td><td>浮点数</td></tr><tr><td><code>title</code></td><td>商品标题。</td><td>字符串</td></tr><tr><td><code>images</code></td><td>商品图片 URL 数组。</td><td>数组</td></tr><tr><td><code>seller</code></td><td>卖家对象，包含卖家详情。</td><td>对象</td></tr><tr><td><code>reviews</code></td><td>评论对象，包含评论详情。</td><td>对象</td></tr><tr><td><code>reviews.count</code></td><td>商品收到的评论数量。</td><td>整数</td></tr><tr><td><code>currency</code></td><td>价格所使用的货币。</td><td>字符串</td></tr><tr><td><code>shipping</code></td><td>运送对象，包含运送详情。</td><td>对象</td></tr><tr><td><code>shipping.from</code></td><td>运送的来源国家。</td><td>字符串</td></tr><tr><td><code>old_price</code></td><td>商品折扣前的原价。</td><td>整数</td></tr><tr><td><code>categories</code></td><td>商品所属分类对象数组。</td><td>数组</td></tr><tr><td><code>categories.title</code></td><td>分类标题。</td><td>字符串</td></tr><tr><td><code>customized</code></td><td>表示商品是否可定制。</td><td>布尔值</td></tr><tr><td><code>product_id</code></td><td>商品的唯一标识符。</td><td>字符串</td></tr><tr><td><code>variation_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/etsy/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>updated_at</code></td><td>抓取任务完成时的时间戳。</td><td>时间戳</td></tr><tr><td><code>page</code></td><td>结果分页中的页码。</td><td>整数</td></tr><tr><td><code>status_code</code></td><td>抓取任务的状态码。你可以查看所描述的爬虫状态码 <a href="https://github.com/oxylabs/gitbook-public-english/blob/master/scraping-solutions/web-scraper-api/targets/etsy/broken-reference/README.md"><strong>此处</strong></a>.</td><td>整数</td></tr><tr><td><code>parser_type</code></td><td>用于提取数据的解析器类型。</td><td>整数</td></tr><tr><td><code>job_id</code></td><td>与抓取任务关联的任务 ID。</td><td>字符串</td></tr></tbody></table>

### 卖家

卖家对象，包含卖家的详细信息。

<div align="center"><figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXckujNQKjQNuMjse1Wtjvktig2WW_ILbup9JGSHnDuCpwNvjnuge6YTm_Trcb0eCX8d1JaUCDxgo49S7WmC0NcIv4kYpFmpweeiRFGYI738t8wVGTAtNwE0N4hu5ejTt2VCH3VUDoEDoIgsUAYomMguJYu0?key=3xpjIOUgn-BXlzCHvQV_ZA" alt=""><figcaption></figcaption></figure></div>

```json
...
"seller": {
    "网址": "https://www.etsy.com/shop/EnchVows?ref=shop-header-name&listing_id=1518307138&from_page=listing",
    "标题": "EnchVows",
    "评分": 4.8247,
    "best_seller": false,
    "星级卖家": true,
    "评价数": 3016
},
...
```

<table><thead><tr><th width="213">键（卖家）</th><th width="385">描述</th><th>类型</th></tr></thead><tbody><tr><td><code>url</code></td><td>卖家页面的 URL。</td><td>字符串</td></tr><tr><td><code>title</code></td><td>卖家的名称。</td><td>字符串</td></tr><tr><td><code>评分</code></td><td>卖家的评分。</td><td>整数</td></tr><tr><td><code>最佳卖家</code></td><td>表示卖家是否为最佳卖家。</td><td>布尔值</td></tr><tr><td><code>星级卖家</code></td><td>表示卖家是否为星级卖家。</td><td>布尔值</td></tr><tr><td><p><code>评价数</code></p><p>（可选）</p></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/etsy/product.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.
