> 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/the-home-depot.md).

# The Home Depot

了解如何开始抓取 The Home Depot。

Home Depot 没有专用数据源。你使用 `universal` 来源，只需传入页面 `url`. 产品页有专用解析器：添加 `"parse": true` 即可接收结构化 JSON，而不是页面 HTML。

{% hint style="warning" %}
对于某些目标，我们的系统 **强制进行 JavaScript 渲染** 即使您未设置 `render`；这些请求会计为已渲染流量。强制渲染的目标列表以及如何关闭渲染，请参见 [在特定页面上强制渲染](/products/cn/web-scraper-api/features/js-rendering-and-browser-control.md#forcing-rendering-on-specific-pages).
{% endhint %}

<table><thead><tr><th width="148.91015625">页面类型</th><th width="416.44140625">URL 格式</th><th width="71.31640625">解析器</th></tr></thead><tbody><tr><td><a href="#search"><strong>搜索页面</strong></a></td><td><code>https://www.homedepot.com/s/&#x3C;search-term></code></td><td>无</td></tr><tr><td><a href="#product"><strong>产品页面</strong></a></td><td><code>https://www.homedepot.com/p/&#x3C;product-name>/&#x3C;product-id></code></td><td>是</td></tr><tr><td><a href="#category"><strong>分类页面</strong></a></td><td><code>https://www.homedepot.com/b/&#x3C;category-path>/N-&#x3C;category-id></code></td><td>无</td></tr></tbody></table>

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

## 搜索

### 请求示例

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

```shell
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "universal",
        "url": "https://www.homedepot.com/s/drill",
        "render": "html"
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint

# Structure payload.
payload = {
    'source': 'universal',
    'url': 'https://www.homedepot.com/s/drill',
    'render': 'html'
}

# 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: "universal",
    url: "https://www.homedepot.com/s/drill",
    render: "html"
};

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=universal&url=https://www.homedepot.com/s/drill&render=html&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'universal',
    'url' => 'https://www.homedepot.com/s/drill',
    'render' => 'html'
);

$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": "universal",
        "url": "https://www.homedepot.com/s/drill",
        "render": "html",
    }

    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 = "universal",
                url = "https://www.homedepot.com/s/drill",
                render = "html"
            };

            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", "universal");
        jsonObject.put("url", "https://www.homedepot.com/s/drill");
        jsonObject.put("render", "html");

        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": "universal",
    "url": "https://www.homedepot.com/s/drill",
    "render": "html"
}
```

{% endtab %}
{% endtabs %}

### 请求参数值

<table><thead><tr><th width="180">参数</th><th>描述</th><th width="160">默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>来源</code></strong></mark></td><td>设置抓取器。Home Depot 页面使用 <code>universal</code> source。</td><td><code>universal</code></td></tr><tr><td><mark style="background-color:green;"><strong><code>url</code></strong></mark></td><td>搜索页的 URL，例如 <code>https://www.homedepot.com/s/drill</code>.</td><td>-</td></tr><tr><td><code>render</code></td><td>启用 JavaScript 渲染，当设置为 <code>html</code>. 如果不渲染，大多数 Home Depot 搜索请求都会失败。</td><td>-</td></tr></tbody></table>

&#x20;   \- 必填参数

## 产品 <a href="#product" id="product"></a>

### 请求示例

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

```shell
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "universal",
        "url": "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint

# Structure payload.
payload = {
    'source': 'universal',
    'url': 'https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378',
    '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: "universal",
    url: "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
    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=universal&url=https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'universal',
    'url' => 'https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378',
    '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": "universal",
        "url": "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
        "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 = "universal",
                url = "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
                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", "universal");
        jsonObject.put("url", "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378");
        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": "universal",
    "url": "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
    "parse": true
}
```

{% endtab %}
{% endtabs %}

### 请求参数值

<table><thead><tr><th width="180">参数</th><th>描述</th><th width="160">默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>来源</code></strong></mark></td><td>设置抓取器。Home Depot 页面使用 <code>universal</code> source。</td><td><code>universal</code></td></tr><tr><td><mark style="background-color:green;"><strong><code>url</code></strong></mark></td><td>产品页的 URL。只包含产品 ID 的简写形式，例如 <code>https://www.homedepot.com/p/100650378</code>，也可以。</td><td>-</td></tr><tr><td><code>parse</code></td><td>当设置为 <code>true</code>. 查看 <a href="#output-data-dictionary">输出数据字典</a>.</td><td><code>false</code></td></tr><tr><td><code>render</code></td><td>启用 JavaScript 渲染，当设置为 <code>html</code>. 如果不渲染，Home Depot 会返回不含配送详情的产品页。</td><td>-</td></tr><tr><td><code>context</code>: <code>store_id</code></td><td>可选的门店本地化设置，参见 <a href="#localization-and-filtering">本地化与筛选</a>.</td><td>-</td></tr></tbody></table>

&#x20;   \- 必填参数

### 响应示例 <a href="#response-example" id="response-example"></a>

商品 ID 的已解析商品页 `100650378` (列表已缩短为一项，长值已截断)：

<details>

<summary>The Home Depot 产品响应示例</summary>

```json
{
    "results": [
        {
            "content": {
                "add_to_cart": true,
                "additional_image_urls": [
                    "https://photos-us.bazaarvoice.com/photo/2/cGhvdG86bWlsd2F1a2VldG9vbA/f84bcd2f-196a-58c8-9aec-de8e54016435"
                ],
                "answered_questions": [
                    {
                        "answer": "电池本身很轻，但在我看来，这台工具比有线版本重约两倍。标注的重量其实差不多。不知道怎么会这样。",
                        "question": "不装电池时重量是多少？"
                    }
                ],
                "answered_questions_count": 452,
                "availability": "in_stock",
                "category": {
                    "name": "Milwaukee 电动工具组合套件",
                    "url": "https://www.homedepot.com/b/Tools-Power-Tools-Power-Tool-Combo-Kits/Milwaukee/N-5yc1vZc2ecZzv"
                },
                "category_tree": [
                    {
                        "name": "首页",
                        "url": "https://www.homedepot.com/"
                    }
                ],
                "category_urls": [
                    "https://www.homedepot.com/"
                ],
                "country_code": "US",
                "currency": "USD",
                "delivery": false,
                "description": "Milwaukee M18 无绳锂离子 2 工具组合套件包含 M18 紧凑型钻/起子机 (2606-20) 和 M18 1/4 英寸六角冲击起子 (2...",
                "details": [
                    {
                        "name": "电池电源类型",
                        "value": "锂离子"
                    }
                ],
                "discontinued": false,
                "domain": "https://www.homedepot.com/",
                "features": [
                    "Milwaukee 四极无框电机采用坚固设计，并结合稀土磁铁，使用寿命更长"
                ],
                "final_price": 199,
                "group_id": "100650378",
                "gtin": "0045242159338",
                "image_urls": [
                    "https://images.thdstatic.com/productImages/ed71b8cb-0cb2-4f52-ade7-f2b2e83e9c76/svn/milwaukee-power-tool-combo-kits-2691-22-64_1000.jpg"
                ],
                "in_stock": true,
                "listing_has_variations": false,
                "main_image": "https://images.thdstatic.com/productImages/ed71b8cb-0cb2-4f52-ade7-f2b2e83e9c76/svn/milwaukee-power-tool-combo-kits-2691-22-64_1000.jpg",
                "manufacturer": "Milwaukee",
                "manufacturer_description": {
                    "details": [
                        {
                            "name": "电池电源类型",
                            "value": "锂离子"
                        }
                    ],
                    "features": [
                        "Milwaukee 四极无框电机采用坚固设计，并结合稀土磁铁，使用寿命更长"
                    ]
                },
                "model_number": "2691-22",
                "mpn": "2691-22",
                "parent_id": "337736538",
                "parse_status_code": 12000,
                "price": "$199.00",
                "product_category": "首页>工具>电动工具>电动工具组合套件>Milwaukee 电动工具组合套件",
                "product_id": "100650378",
                "product_name": "M18 18V 锂离子无绳钻/起子机/冲击起子组合套件（2 工具）配两块 1.5Ah 电池、充电器和工具包",
                "rating": 4.6,
                "related_documents": [
                    {
                        "name": "SDS",
                        "url": "https://images.thdstatic.com/catalog/pdfImages/39/39b14438-5bf1-4568-a268-062fcb9b7c8b.pdf"
                    }
                ],
                "return_policy": "https://www.homedepot.com/c/Return_Policy",
                "return_window": 90,
                "review_count": 9253,
                "reviews": [
                    {
                        "content": "[此评论作为促销活动的一部分收集。] 拥有一台 Milwaukee 无刷钻机和充电器，配 2 cp 2.0 M18 锂...",
                        "max_rating": 5,
                        "min_rating": 1,
                        "rating": 5,
                        "review_id": "402310729",
                        "title": "价格表现不错，接受旧款 M18 电池"
                    }
                ],
                "reviews_count": 9253,
                "root_category": {
                    "name": "首页",
                    "url": "https://www.homedepot.com/"
                },
                "seller_privacy_policy": "https://www.homedepot.com/privacy/privacy-and-security-statement",
                "seller_tos": "https://www.homedepot.com/c/Terms_of_Use",
                "seller_url": "https://www.homedepot.com",
                "ship_to_store": false,
                "sku": "233545",
                "star_rating": 5,
                "store_country": "US",
                "store_name": "Cumberland",
                "target_countries": [
                    "US"
                ],
                "top_reviews": [
                    {
                        "description": "[此评论作为促销活动的一部分收集。] 拥有一台 Milwaukee 无刷钻机和充电器，配 2 cp 2.0 M18 锂...",
                        "name": "DIY Al",
                        "rating": 5,
                        "title": "价格表现不错，接受旧款 M18 电池"
                    }
                ],
                "upc": "045242159338",
                "upcgtin13": "0045242159338",
                "url": "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
                "video_count": 2,
                "warranty": {
                    "available": true,
                    "length": "5 年保修（工具），2 年保修（电池）",
                    "type": "制造商保修"
                }
            },
            "created_at": "2026-09-28 03:37:29",
            "updated_at": "2026-09-28 03:37:35",
            "page": 1,
            "url": "https://www.homedepot.com/p/Milwaukee-M18-18V-Lithium-Ion-Cordless-Drill-Driver-Impact-Driver-Combo-Kit-2-Tool-W-Two-1-5Ah-Batteries-Charger-Tool-Bag-2691-22/100650378",
            "job_id": "7510180859647894529",
            "status_code": 200,
            "is_render_forced": false,
            "parser_type": "homedepot_product"
        }
    ]
}
```

</details>

### 输出数据字典 <a href="#output-data-dictionary" id="output-data-dictionary"></a>

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

<table><thead><tr><th width="204.33984375">键</th><th width="346.765625">描述</th><th width="90.078125">类型</th></tr></thead><tbody><tr><td><code>url</code></td><td>商品页面的 URL。</td><td>字符串</td></tr><tr><td><code>product_id</code></td><td>The Home Depot 产品 ID，即产品 URL 末尾的 9 位数字。</td><td>字符串</td></tr><tr><td><code>parent_id</code></td><td>该商品所属父商品的 ID。</td><td>字符串</td></tr><tr><td><code>group_id</code></td><td>产品组的 ID。</td><td>字符串</td></tr><tr><td><code>sku</code></td><td>The Home Depot 门店 SKU。</td><td>字符串</td></tr><tr><td><code>model_number</code></td><td>制造商型号。</td><td>字符串</td></tr><tr><td><code>mpn</code></td><td>制造商零件号。</td><td>字符串</td></tr><tr><td><code>upc</code></td><td>UPC 条码号。</td><td>字符串</td></tr><tr><td><code>gtin</code></td><td>产品的 GTIN。</td><td>字符串</td></tr><tr><td><code>upcgtin13</code></td><td>UPC 的 13 位 GTIN 形式。</td><td>字符串</td></tr><tr><td><code>product_name</code></td><td>商品名称。</td><td>字符串</td></tr><tr><td><code>manufacturer</code></td><td>产品的品牌或制造商。</td><td>字符串</td></tr><tr><td><code>description</code></td><td>产品描述。</td><td>字符串</td></tr><tr><td><code>features</code></td><td>产品特性要点列表。</td><td>数组</td></tr><tr><td><code>details</code></td><td>以名称-值对形式列出的产品规格列表。</td><td>数组</td></tr><tr><td><code>details.name</code></td><td>规格名称。</td><td>字符串</td></tr><tr><td><code>details.value</code></td><td>规格值。</td><td>字符串</td></tr><tr><td><code>manufacturer_description</code></td><td>重复制造商的对象 <code>details</code> 和 <code>features</code> 列表。</td><td>对象</td></tr><tr><td><code>price</code></td><td>页面上显示的价格，带货币符号，例如 <code>$199.00</code>.</td><td>字符串</td></tr><tr><td><code>final_price</code></td><td>价格数值。</td><td>浮点数</td></tr><tr><td><code>currency</code></td><td>货币的 ISO 4217 三字母代码。</td><td>字符串</td></tr><tr><td><code>availability</code></td><td>可用性状态，例如 <code>in_stock</code>.</td><td>字符串</td></tr><tr><td><code>in_stock</code></td><td>指示产品是否有库存。</td><td>布尔值</td></tr><tr><td><code>discontinued</code></td><td>指示产品是否已停产。</td><td>布尔值</td></tr><tr><td><code>add_to_cart</code></td><td>指示产品是否可加入购物车。</td><td>布尔值</td></tr><tr><td><code>delivery</code></td><td>指示是否提供配送。仅在页面渲染后才准确（<code>"render": "html"</code>）；不渲染时会返回为 <code>false</code>.</td><td>布尔值</td></tr><tr><td><code>ship_to_store</code></td><td>指示是否提供门店自提配送。仅在页面渲染后才准确（<code>"render": "html"</code>）；不渲染时会返回为 <code>false</code>.</td><td>布尔值</td></tr><tr><td><code>shipping_cost</code> （可选）</td><td>运输费用列表；每种履约方式对应一个对象： <code>ship_to_store</code>, <code>delivery</code> 或两者兼有。仅在页面渲染后返回（<code>"render": "html"</code>).</td><td>数组</td></tr><tr><td><code>shipping_cost.ship_to_store</code></td><td>门店自提费用： <code>shipping_price</code> (数字， <code>0</code> 免费时）以及 <code>currency</code>.</td><td>对象</td></tr><tr><td><code>shipping_cost.delivery</code></td><td>送货上门费用： <code>shipping_price</code> (数字， <code>0</code> 免费时）以及 <code>currency</code>.</td><td>对象</td></tr><tr><td><code>store_name</code></td><td>页面所对应门店的名称，例如 <code>Hutchinson</code>.</td><td>字符串</td></tr><tr><td><code>zipcode</code> （可选）</td><td>显示时，该门店的 ZIP 代码。</td><td>字符串</td></tr><tr><td><code>store_country</code></td><td>门店所在国家。</td><td>字符串</td></tr><tr><td><code>country_code</code></td><td>网站所在国家代码。</td><td>字符串</td></tr><tr><td><code>target_countries</code></td><td>产品销售到的国家列表。</td><td>数组</td></tr><tr><td><code>评分</code></td><td>产品的平均评分。</td><td>浮点数</td></tr><tr><td><code>star_rating</code></td><td>四舍五入到整星的评分。</td><td>整数</td></tr><tr><td><code>评论数</code></td><td>评论数量。</td><td>整数</td></tr><tr><td><code>reviews_count</code></td><td>评论数量（与 <code>评论数</code>).</td><td>整数</td></tr><tr><td><code>reviews</code></td><td>页面上显示的评论列表。</td><td>数组</td></tr><tr><td><code>reviews.review_id</code></td><td>评论的 ID。</td><td>字符串</td></tr><tr><td><code>reviews.title</code></td><td>评论标题。</td><td>字符串</td></tr><tr><td><code>reviews.content</code></td><td>评论文本。</td><td>字符串</td></tr><tr><td><code>reviews.rating</code></td><td>评论中的评分。</td><td>整数</td></tr><tr><td><code>reviews.min_rating</code></td><td>最低可能评分。</td><td>整数</td></tr><tr><td><code>reviews.max_rating</code></td><td>最高可能评分。</td><td>整数</td></tr><tr><td><code>top_reviews</code></td><td>页面上显示的优质评论列表。</td><td>数组</td></tr><tr><td><code>top_reviews.name</code></td><td>评论者姓名。</td><td>字符串</td></tr><tr><td><code>top_reviews.title</code></td><td>评论标题。</td><td>字符串</td></tr><tr><td><code>top_reviews.description</code></td><td>评论文本。</td><td>字符串</td></tr><tr><td><code>top_reviews.rating</code></td><td>评论中的评分。</td><td>整数</td></tr><tr><td><code>answered_questions</code></td><td>带答案的客户问题列表。</td><td>数组</td></tr><tr><td><code>answered_questions.question</code></td><td>问题。</td><td>字符串</td></tr><tr><td><code>answered_questions.answer</code></td><td>答案。</td><td>字符串</td></tr><tr><td><code>answered_questions_count</code></td><td>已回答问题数量。</td><td>整数</td></tr><tr><td><code>main_image</code></td><td>主产品图片的 URL。</td><td>字符串</td></tr><tr><td><code>image_urls</code></td><td>产品图片 URL 列表。</td><td>数组</td></tr><tr><td><code>additional_image_urls</code></td><td>客户照片 URL 列表。</td><td>数组</td></tr><tr><td><code>video_count</code></td><td>产品视频数量。</td><td>整数</td></tr><tr><td><code>category</code></td><td>产品所属类别。</td><td>对象</td></tr><tr><td><code>category.name</code></td><td>类别名称。</td><td>字符串</td></tr><tr><td><code>category.url</code></td><td>类别 URL。</td><td>字符串</td></tr><tr><td><code>category_tree</code></td><td>从顶级类别到产品类别的类别列表。</td><td>数组</td></tr><tr><td><code>category_tree.name</code></td><td>类别名称。</td><td>字符串</td></tr><tr><td><code>category_tree.url</code></td><td>类别 URL。</td><td>字符串</td></tr><tr><td><code>category_urls</code></td><td>类别路径中的类别 URL 列表。</td><td>数组</td></tr><tr><td><code>root_category</code></td><td>顶级类别。</td><td>对象</td></tr><tr><td><code>root_category.name</code></td><td>顶级类别名称。</td><td>字符串</td></tr><tr><td><code>root_category.url</code></td><td>顶级类别 URL。</td><td>字符串</td></tr><tr><td><code>product_category</code></td><td>完整类别路径，由以下分隔符分隔 <code>></code>.</td><td>字符串</td></tr><tr><td><code>listing_has_variations</code></td><td>指示产品是否有变体。</td><td>布尔值</td></tr><tr><td><code>warranty</code></td><td>包含保修信息的对象。</td><td>对象</td></tr><tr><td><code>warranty.available</code></td><td>指示是否提供保修。</td><td>布尔值</td></tr><tr><td><code>warranty.type</code></td><td>保修类型。</td><td>字符串</td></tr><tr><td><code>warranty.length</code></td><td>保修期限。</td><td>字符串</td></tr><tr><td><code>related_documents</code></td><td>产品相关文档列表，例如手册或指南。</td><td>数组</td></tr><tr><td><code>related_documents.name</code></td><td>文档名称。</td><td>字符串</td></tr><tr><td><code>related_documents.url</code></td><td>文档 URL。</td><td>字符串</td></tr><tr><td><code>return_window</code></td><td>退货期限，按天计算。</td><td>整数</td></tr><tr><td><code>return_policy</code></td><td>退货政策 URL。</td><td>字符串</td></tr><tr><td><code>seller_url</code></td><td>卖家 URL。</td><td>字符串</td></tr><tr><td><code>seller_tos</code></td><td>卖家使用条款 URL。</td><td>字符串</td></tr><tr><td><code>seller_privacy_policy</code></td><td>卖家隐私政策 URL。</td><td>字符串</td></tr><tr><td><code>domain</code></td><td>抓取页面来源的网站。</td><td>字符串</td></tr><tr><td><code>parse_status_code</code></td><td>解析任务的状态代码。你可以查看解析器状态代码说明 <strong>这里</strong>.</td><td>整数</td></tr><tr><td><code>created_at</code></td><td>抓取任务创建时的时间戳。</td><td>timestamp</td></tr><tr><td><code>updated_at</code></td><td>抓取任务完成时的时间戳。</td><td>timestamp</td></tr><tr><td><code>page</code></td><td>结果分页中的页码。</td><td>整数</td></tr><tr><td><code>status_code</code></td><td>被抓取页面的 HTTP 状态码。</td><td>整数</td></tr><tr><td><code>is_render_forced</code></td><td>标识此请求是否强制渲染。</td><td>布尔值</td></tr><tr><td><code>parser_type</code></td><td>用于提取数据的解析器类型， <code>homedepot_product</code>.</td><td>字符串</td></tr><tr><td><code>job_id</code></td><td>与抓取任务相关联的任务 ID。</td><td>字符串</td></tr></tbody></table>

## 类别

### 请求示例

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

```shell
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "universal",
        "url": "https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f"
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint

# Structure payload.
payload = {
    'source': 'universal',
    'url': 'https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f'
}

# 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: "universal",
    url: "https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f"
};

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=universal&url=https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'universal',
    'url' => 'https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f'
);

$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": "universal",
        "url": "https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f",
    }

    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 = "universal",
                url = "https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f"
            };

            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", "universal");
        jsonObject.put("url", "https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f");

        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": "universal",
    "url": "https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f"
}
```

{% endtab %}
{% endtabs %}

### 请求参数值

<table><thead><tr><th width="180">参数</th><th>描述</th><th width="160">默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>来源</code></strong></mark></td><td>设置抓取器。Home Depot 页面使用 <code>universal</code> source。</td><td><code>universal</code></td></tr><tr><td><mark style="background-color:green;"><strong><code>url</code></strong></mark></td><td>类别页的 URL，例如 <code>https://www.homedepot.com/b/Tools-Power-Tools-Drills/N-5yc1vZc27f</code>.</td><td>-</td></tr></tbody></table>

&#x20;   \- 必填参数

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

<table><thead><tr><th width="103.66796875">参数</th><th width="88.19140625">适用于</th><th width="485.5">描述</th><th width="83.234375">默认</th></tr></thead><tbody><tr><td><code>context</code>: <code>store_id</code></td><td>产品页</td><td>Home Depot 门店编号，格式为 4 位字符串。可在 <a href="https://www.homedepot.com/l/storeDirectory">Home Depot 门店目录</a>；其编号是门店页面 URL 的最后一部分，例如 <code>homedepot.com/l/21st-South/UT/Salt-Lake-City/84115/</code><strong><code>4403</code></strong>. 三位数前补 0，例如 121 → <code>"0121"</code>. 解析后的 <code>store_name</code> 显示页面所对应的门店。不要与 <code>render</code>.</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/the-home-depot.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.
