> For the complete documentation index, see [llms.txt](https://docs.scraperapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scraperapi.com/structured-data-endpoints/e-commerce/homedepot/homedepot-product-api-async.md).

# Home Depot Product API (Async)

The `Home Depot Product API` endpoint returns the details of a single Home Depot product.

**Single Product Request**

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

```bash
curl -X POST \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"item_id": "ITEM_ID",
			"callback": {
				"type": "webhook",
				"url": "YYYYY"
			}
		}' \
"https://async.scraperapi.com/structured/homedepot/product"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://async.scraperapi.com/structured/homedepot/product"
headers = {
    "Content-Type": "application/json"
}
data = {
    "apiKey": "API_KEY",
    "item_id": "ITEM_ID",
    "callback": {
        "type": "webhook",
        "url": "YYYYY"
    }
}

response = requests.post(url, json=data, headers=headers)
print(response.text)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import fetch from 'node-fetch';

const options = {
  method: 'POST',
  body: JSON.stringify({
    apiKey: 'API_KEY',
    item_id: 'ITEM_ID',
    callback: {
            type: 'webhook',
            url: 'YYYYY' }}),
  headers: {
    'Content-Type': 'application/json',
  },
}

fetch('https://async.scraperapi.com/structured/homedepot/product', options)
  .then(response => {
    response.text().then(text => console.log(text));
  })
  .catch(error => {
    console.log(error)
  })
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$data = json_encode(array(
    'apiKey' => 'API_KEY',
    'item_id' => 'ITEM_ID',
    'callback' => array(
        'type' => 'webhook',
        'url' => 'YYYYY'
    )
));

$ch = curl_init('https://async.scraperapi.com/structured/homedepot/product');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

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

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://async.scraperapi.com/structured/homedepot/product')
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = {
  apiKey: 'API_KEY',
  item_id: 'ITEM_ID',
  callback: {
    type: 'webhook',
    url: 'YYYYY'
  }
}.to_json
begin
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end
  puts response.body
rescue => e
  puts "Error: #{e.message}"
end
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) {
        try {
            String apiKey = "API_KEY";
            String jsonInputString = "{"
                + "\"apiKey\": \"" + apiKey + "\", "
                + "\"item_id\": \"ITEM_ID\", "
                + "\"callback\": {"
                + "    \"type\": \"webhook\", "
                + "    \"url\": \"YYYYY\""
                + "}}";

            URL url = new URL("https://async.scraperapi.com/structured/homedepot/product");
            HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Accept", "*/*");
            connection.setDoOutput(true);
            try (OutputStream os = connection.getOutputStream()) {
                byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
            }
            int responseCode = connection.getResponseCode();
            StringBuilder response = new StringBuilder();
            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String readLine;
            while ((readLine = in.readLine()) != null) {
                response.append(readLine);
            }
            in.close();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                System.out.println("Response: " + response.toString());
            } else {
                throw new Exception("Error in API Call: Response code " + responseCode + "\nbody: " + response.toString());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Multiple Products Request**

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

```bash
curl -X POST \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"item_ids": ["ITEM_ID1", "ITEM_ID2"],
			"callback": {
				"type": "webhook",
				"url": "YYYYY"
			}
		}' \
"https://async.scraperapi.com/structured/homedepot/product"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://async.scraperapi.com/structured/homedepot/product"
headers = {
    "Content-Type": "application/json"
}
data = {
    "apiKey": "API_KEY",
    "item_ids": ["ITEM_ID1", "ITEM_ID2"],
    "callback": {
        "type": "webhook",
        "url": "YYYYY"
    }
}

response = requests.post(url, json=data, headers=headers)
print(response.text)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import fetch from 'node-fetch';

const options = {
  method: 'POST',
  body: JSON.stringify({
    apiKey: 'API_KEY',
    item_ids: ['ITEM_ID1', 'ITEM_ID2'],
    callback: {
            type: 'webhook',
            url: 'YYYYY' }}),
  headers: {
    'Content-Type': 'application/json',
  },
}

fetch('https://async.scraperapi.com/structured/homedepot/product', options)
  .then(response => {
    response.text().then(text => console.log(text));
  })
  .catch(error => {
    console.log(error)
  })
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$data = json_encode(array(
    'apiKey' => 'API_KEY',
    'item_ids' => ['ITEM_ID1', 'ITEM_ID2'],
    'callback' => array(
        'type' => 'webhook',
        'url' => 'YYYYY'
    )
));

$ch = curl_init('https://async.scraperapi.com/structured/homedepot/product');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

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

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://async.scraperapi.com/structured/homedepot/product')
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = {
  apiKey: 'API_KEY',
  item_ids: ['ITEM_ID1', 'ITEM_ID2'],
  callback: {
    type: 'webhook',
    url: 'YYYYY'
  }
}.to_json
begin
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end
  puts response.body
rescue => e
  puts "Error: #{e.message}"
end
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) {
        try {
            String apiKey = "API_KEY";
            String jsonInputString = "{"
                + "\"apiKey\": \"" + apiKey + "\", "
                + "\"item_ids\": [\"ITEM_ID1\", \"ITEM_ID2\"], "
                + "\"callback\": {"
                + "    \"type\": \"webhook\", "
                + "    \"url\": \"YYYYY\""
                + "}}";

            URL url = new URL("https://async.scraperapi.com/structured/homedepot/product");
            HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Accept", "*/*");
            connection.setDoOutput(true);
            try (OutputStream os = connection.getOutputStream()) {
                byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
            }
            int responseCode = connection.getResponseCode();
            StringBuilder response = new StringBuilder();
            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String readLine;
            while ((readLine = in.readLine()) != null) {
                response.append(readLine);
            }
            in.close();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                System.out.println("Response: " + response.toString());
            } else {
                throw new Exception("Error in API Call: Response code " + responseCode + "\nbody: " + response.toString());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Supported Parameters**

<table><thead><tr><th width="397">Parameters</th><th>Details</th></tr></thead><tbody><tr><td><code>API_KEY</code> (required)</td><td>Your API Key.</td></tr><tr><td><code>ITEM_ID</code> (required)</td><td><p>Home Depot Internet number, the number at the end of the product URL. Required unless <code>GTIN</code> or <code>URL</code> is provided. <br><br><strong>Example:</strong> <code>320326855</code></p><p><br>To submit several products in one request, send them as an array in <code>item_ids</code> instead. Each item ID creates its own job.</p></td></tr><tr><td><code>GTIN</code></td><td><p>Product barcode (UPC, EAN or GTIN), used instead of <code>ITEM_ID</code>. <br><br><strong>Example:</strong> <code>045242637720</code></p><p></p><p><strong>Note:</strong> The barcode must match exactly one Home Depot product. If it matches none or several, the response is <code>"Product not found."</code></p></td></tr><tr><td><code>URL</code></td><td>A Home Depot product page URL, used instead of <code>ITEM_ID</code>.<br><br><strong>Example:</strong> <code>https://www.homedepot.com/p/320326855</code></td></tr><tr><td><code>OUTPUT_FORMAT</code></td><td><p>This endpoint returns JSON output only. CSV is not supported.<br></p><p><strong>Options:</strong></p><ul><li>json (default)</li></ul></td></tr></tbody></table>

{% hint style="info" %}
Only one product identifier is used per request. If you send more than one, `URL` takes priority, then `GTIN`, then `ITEM_ID`.
{% endhint %}

### Sample Response

Single Product Request

```json
{
  "id": "a6906524-59a5-49f7-be13-78dc09cd1c9f",
  "attempts": 0,
  "status": "running",
  "statusUrl": "https://async.scraperapi.com/jobs/a6906524-59a5-49f7-be13-78dc09cd1c9f",
  "item_id": "320326855"
}
```

Multiple Products Request

```json
[
  {
    "id": "955db003-16ae-4ac6-bc2b-117b324e7ade",
    "attempts": 0,
    "status": "running",
    "statusUrl": "https://async.scraperapi.com/jobs/955db003-16ae-4ac6-bc2b-117b324e7ade",
    "item_id": "320326855"
  },
  {
    "id": "3600d99b-d35f-4653-8e34-95fad5a895a2",
    "attempts": 0,
    "status": "running",
    "statusUrl": "https://async.scraperapi.com/jobs/3600d99b-d35f-4653-8e34-95fad5a895a2",
    "item_id": "204279858"
  }
]
```

After the job(s) finish, you will find the result under the <mark style="color:red;">response</mark> key in the response JSON object. The structure is the same as in the corresponding SYNC data endpoint.


---

# 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://docs.scraperapi.com/structured-data-endpoints/e-commerce/homedepot/homedepot-product-api-async.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.
