> 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-reviews-api.md).

# Home Depot Reviews API

The `Home Depot Reviews API` endpoint returns customer reviews for a single Home Depot product.

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

```bash
curl --request GET \
--url "https://api.scraperapi.com/structured/homedepot/reviews?api_key=API_KEY\
&item_id=ITEM_ID"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

payload = {
    "api_key": "API_KEY",
    "item_id": "ITEM_ID"
}

r = requests.get('https://api.scraperapi.com/structured/homedepot/reviews', params=payload)

print(r.text)
```

{% endtab %}

{% tab title="NodeJS" %}

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

const params = new URLSearchParams({
  api_key: 'API_KEY',
  item_id: 'ITEM_ID'
});

fetch(`https://api.scraperapi.com/structured/homedepot/reviews?${params}`)
  .then(response => response.json())
  .then(data => {
    console.log(data);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$params = array(
    'api_key' => 'API_KEY',
    'item_id' => 'ITEM_ID'
);
$url = "https://api.scraperapi.com/structured/homedepot/reviews?" . http_build_query($params);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
```

{% endtab %}

{% tab title="Ruby" %}

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

params = {
  :api_key => "API_KEY",
  :item_id => "ITEM_ID"
}

uri = URI('https://api.scraperapi.com/structured/homedepot/reviews')
uri.query = URI.encode_www_form(params)

website_content = Net::HTTP.get(uri)
print(website_content)
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) {
        try {
            String apiKey = "API_KEY";
            String itemId = URLEncoder.encode("ITEM_ID", StandardCharsets.UTF_8);

            String urlStr = "https://api.scraperapi.com/structured/homedepot/reviews?api_key="
                            + apiKey + "&item_id=" + itemId;

            URL url = new URL(urlStr);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");

            int responseCode = conn.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                StringBuilder response = new StringBuilder();
                String line;
                while ((line = in.readLine()) != null) {
                    response.append(line);
                }
                in.close();
                System.out.println(response.toString());
            } else {
                System.out.println("Error in API Call. Response code: " + responseCode);
            }

        } 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 item number, the number at the end of the product URL. Required unless <code>GTIN</code> or <code>URL</code> is provided. </p><p></p><p><strong>Example:</strong> <code>320326855</code></p></td></tr><tr><td><code>PAGE</code></td><td>Reviews page number. Each page contains up to 30 reviews. Defaults to <code>1</code>. Used only with <code>ITEM_ID</code>.</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><br><strong>Note:</strong> Returns the 1st page with 10 reviews only. The barcode must match exactly one Home Depot product.</p></td></tr><tr><td><code>URL</code></td><td><p>A Home Depot product page or reviews page URL, used instead of <code>ITEM_ID</code>.<br></p><ul><li>Product page (e.g. <code>https://www.homedepot.com/p/320326855</code>): returns the first 10 reviews only.</li><li>Reviews page (e.g. <code>https://www.homedepot.com/p/reviews/x/320326855/3</code>): returns that page, up to 30 reviews.</li></ul></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`. To page through all reviews, use `ITEM_ID` with `PAGE`.
{% endhint %}

{% hint style="info" %}
Home Depot can show reviews from related products on a product's reviews page. Each review's `item_id` identifies the product it belongs to, which may differ from the requested product.
{% endhint %}

### Sample Response

```json
{
  "success": true,
  "payload": {
    "reviews": [
      {
        "position": 1,
        "id": "242135711",
        "item_id": "320326855",
        "title": "Powerful drill",
        "body": "These are the only drills I use, drilling 1/2 to 3/4 inch holes in studs with ease.",
        "rating": 5,
        "positive_feedback": 0,
        "negative_feedback": 0,
        "date": "2023-02-27T03:08:28.000+00:00",
        "is_recommended": true,
        "is_early_reviewer_incentive": false,
        "is_incentivized_review": false,
        "is_top_1000_contributor": false,
        "is_top_250_contributor": false,
        "images": [
          {
            "id": "21968147",
            "link": "https://photos-us.bazaarvoice.com/photo/2/cGhvdG86bWlsd2F1a2VldG9vbA/4d89a174-008f-53b4-bd21-fbcdd0aaed64"
          }
        ],
        "source": {
          "is_external_source": true,
          "external_source": true,
          "author_name": "Waldorf",
          "author_id": "e7j8qzwq3234i33z41ux4qvtx",
          "author_location": "Kitimat",
          "verified_purchase": false
        }
      },
      {
        "position": 2,
        "id": "261592300",
        "item_id": "320326862",
        "title": "Another Great Product by Milwaukee!",
        "body": "This Milwaukee M18 FUEL 1/2 inch Hammer Drill Driver runs on the Milwaukee 18v lithium ion M18 platform. This Drill driver works fantastic. It feels smoother that my older drill driver...",
        "campaign_id": "bvsampling_august_2022_major_seeds_campaign_2022082",
        "rating": 5,
        "positive_feedback": 1,
        "negative_feedback": 0,
        "date": "2022-09-30T13:29:59.000+00:00",
        "is_recommended": true,
        "is_early_reviewer_incentive": false,
        "is_incentivized_review": false,
        "is_top_1000_contributor": false,
        "is_top_250_contributor": false,
        "images": [
          {
            "id": "8877714",
            "link": "https://photos-us.bazaarvoice.com/photo/2/cGhvdG86aG9tZWRlcG90/a217ee9f-ff11-50f1-a409-1babde7dd873"
          }
        ],
        "source": {
          "is_external_source": true,
          "external_source": false,
          "author_name": "HomeDepotCustomer",
          "author_id": "03007C99B4AD1D697S",
          "author_location": "NY",
          "verified_purchase": false
        }
      }
    ],
    "summary": {
      "rating": 4.7,
      "ratings_total": 1698,
      "recommended_count": 483,
      "not_recommended_count": 36,
      "rating_breakdown": {
        "five_star": 1450,
        "four_star": 126,
        "three_star": 30,
        "two_star": 16,
        "one_star": 76
      }
    },
    "product": {
      "item_id": "320326855"
    },
    "pagination": {
      "current_page": 3,
      "next_page": 4,
      "total_pages": 57,
      "total_reviews": 1698
    }
  }
}
```


---

# 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-reviews-api.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.
