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

# Home Depot Search API

The `Home Depot Search API` endpoint returns a list of Home Depot products based on a search term.

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

```bash
curl --request GET \
--url "https://api.scraperapi.com/structured/homedepot/search?api_key=API_KEY&\
search_term=SEARCH_TERM&page=PAGE&sort_by=SORT_BY"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

payload = {
    "api_key": "API_KEY",
    "search_term": "SEARCH_TERM",
    "page": "PAGE",
    "sort_by": "SORT_BY"
}

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

print(r.text)
```

{% endtab %}

{% tab title="NodeJS" %}

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

const params = new URLSearchParams({
  api_key: 'API_KEY',
  search_term: 'SEARCH_TERM',
  page: 'PAGE',
  sort_by: 'SORT_BY'
});

fetch(`https://api.scraperapi.com/structured/homedepot/search?${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',
    'search_term' => 'SEARCH_TERM',
    'page' => 'PAGE',
    'sort_by' => 'SORT_BY'
);
$url = "https://api.scraperapi.com/structured/homedepot/search?" . 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",
  :search_term => "SEARCH_TERM",
  :page => "PAGE",
  :sort_by => "SORT_BY"
}

uri = URI('https://api.scraperapi.com/structured/homedepot/search')
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 searchTerm = URLEncoder.encode("SEARCH_TERM", StandardCharsets.UTF_8);
            String page = "PAGE";
            String sortBy = "SORT_BY";

            String urlStr = "https://api.scraperapi.com/structured/homedepot/search?api_key="
                            + apiKey + "&search_term=" + searchTerm + "&page=" + page + "&sort_by=" + sortBy;

            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 data-search="false"><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>SEARCH_TERM</code> (required)</td><td>Search term. Required unless <code>URL</code> is provided. Example: <code>milwaukee cordless drill</code></td></tr><tr><td><code>URL</code></td><td><p>A Home Depot search results URL, used instead of <code>SEARCH_TERM</code>. Both <code>/s/</code> (keyword search) and <code>/b/</code> (category browse) URLs are accepted.<br><br>Example: <code>https://www.homedepot.com/s/milwaukee%20cordless%20drill?Nao=24</code> <br></p><p><strong>Note:</strong> When <code>URL</code> is provided, <code>PAGE</code>, <code>SORT_BY</code>, <code>MIN_PRICE</code> and <code>MAX_PRICE</code> are ignored. Paginate or refine by changing the URL itself, or follow <code>pagination.next.link</code>.</p></td></tr><tr><td><code>PAGE</code></td><td>Page number. Each page contains up to 24 results. Defaults to page <code>1</code>.</td></tr><tr><td><code>SORT_BY</code></td><td><p>Instructs the API to sort the results. Supported values:</p><p><br>best_seller<br>most_popular<br>price_low_to_high<br>price_high_to_low<br>highest_rating</p></td></tr><tr><td><code>MIN_PRICE</code></td><td>Minimum product price in USD. Example: <code>100</code> </td></tr><tr><td><code>MAX_PRICE</code></td><td>Maximum product price in USD. Example: <code>500</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><br>• json (default)</p></td></tr></tbody></table>

{% hint style="info" %}
Home Depot's result ranking can change between requests, so the same product may appear on more than one page. Use `item_id` to deduplicate results when paginating.
{% endhint %}

{% hint style="warning" %}
Results are localized to a default Home Depot store (returned in `location_info`). Selecting a specific store or ZIP code is not currently supported, so `fulfillment` data (pickup, ship-to-store, stock levels) reflects that default store only.
{% endhint %}

### Sample Response

```json
{
  "success": true,
  "payload": {
    "search_results": [
      {
        "position": 1,
        "product": {
          "title": "Milwaukee M18 FUEL 18V Lithium-Ion Brushless Cordless 1/2 in. Hammer Drill/Driver (Tool-Only)",
          "link": "https://www.homedepot.com/p/Milwaukee-M18-FUEL-18V-Lithium-Ion-Brushless-Cordless-1-2-in-Hammer-Drill-Driver-Tool-Only-2904-20/320326855",
          "is_bestseller": true,
          "is_exclusive": true,
          "brand": "Milwaukee",
          "item_id": "320326855",
          "store_sku": "1007901514",
          "model_number": "2904-20",
          "images": [
            "https://images.thdstatic.com/productImages/66a60fa5-5897-46a9-bfb4-60e508951421/svn/milwaukee-hammer-drills-2904-20-64_1000.jpg",
            "https://images.thdstatic.com/productImages/5368ac20-27de-4e79-9d7d-6f391dc1241c/svn/milwaukee-hammer-drills-2904-20-e4_1000.jpg"
          ],
          "primary_image": "https://images.thdstatic.com/productImages/66a60fa5-5897-46a9-bfb4-60e508951421/svn/milwaukee-hammer-drills-2904-20-64_1000.jpg",
          "rating": 4.7,
          "ratings_total": 1687
        },
        "fulfillment": {
          "pickup": true,
          "ship_to_store": false,
          "ship_to_home": true,
          "scheduled_delivery": true,
          "pickup_info": {
            "store_id": "121",
            "store_state": "GA",
            "store_name": "Cumberland",
            "in_stock": true,
            "stock_level": 14
          },
          "ship_to_home_info": {
            "store_id": "8119",
            "in_stock": true,
            "stock_level": 725,
            "price": 0,
            "start_date": "2026-09-30",
            "end_date": "2026-09-30",
            "delivery_date_name": "today"
          },
          "scheduled_delivery_info": {
            "store_id": "121",
            "store_state": "GA",
            "store_name": "Cumberland",
            "in_stock": true,
            "stock_level": 14,
            "price": 0,
            "start_date": "2026-09-30",
            "end_date": "2026-09-30",
            "delivery_date_name": "today"
          }
        },
        "offers": {
          "primary": {
            "price": 229,
            "symbol": "$",
            "currency": "USD"
          }
        }
      },
      {
        "position": 2,
        "product": {
          "title": "DEWALT 20V MAX Cordless 1/2 in. Drill/Driver, (2) 20V 1.3Ah Batteries, Charger and Bag",
          "link": "https://www.homedepot.com/p/DEWALT-20V-MAX-Cordless-1-2-in-Drill-Driver-2-20V-1-3Ah-Batteries-Charger-and-Bag-DCD771C2/204279858",
          "is_top_rated": true,
          "brand": "DEWALT",
          "item_id": "204279858",
          "parent_item_id": "320080548",
          "store_sku": "1000014677",
          "model_number": "DCD771C2",
          "images": [
            "https://images.thdstatic.com/productImages/d00a1384-69ea-4f77-a5c3-c0ac8fd531fa/svn/dewalt-power-drills-dcd771c2-64_1000.jpg",
            "https://images.thdstatic.com/productImages/26d5ac8e-18c5-4d42-bc9c-db5bc83a1c11/svn/dewalt-power-drills-dcd771c2-e4_1000.jpg"
          ],
          "primary_image": "https://images.thdstatic.com/productImages/d00a1384-69ea-4f77-a5c3-c0ac8fd531fa/svn/dewalt-power-drills-dcd771c2-64_1000.jpg",
          "rating": 4.6,
          "ratings_total": 11390,
          "collection": {
            "id": "Family-311372814",
            "name": "DEWALT Garage Collection",
            "link": "https://www.homedepot.com/collection/Hardware/DEWALT-Garage-Collection/Family-311372814?omsid=204279858"
          }
        },
        "fulfillment": {
          "pickup": false,
          "ship_to_store": true,
          "ship_to_home": true,
          "scheduled_delivery": false,
          "ship_to_store_info": {
            "store_id": "121",
            "store_state": "GA",
            "store_name": "Cumberland",
            "in_stock": true,
            "stock_level": 317
          },
          "ship_to_home_info": {
            "store_id": "8119",
            "in_stock": true,
            "stock_level": 317,
            "price": 0,
            "start_date": "2026-09-30",
            "end_date": "2026-09-30",
            "delivery_date_name": "today"
          }
        },
        "offers": {
          "primary": {
            "price": 119,
            "symbol": "$",
            "currency": "USD"
          }
        }
      }
    ],
    "pagination": {
      "total_results": 1560,
      "total_pages": 65,
      "current": {
        "page": 1,
        "link": "https://www.homedepot.com/s/milwaukee%20cordless%20drill?lowerBound=100&upperBound=500&Nao=0"
      },
      "next": {
        "page": 2,
        "link": "https://www.homedepot.com/s/milwaukee%20cordless%20drill?lowerBound=100&upperBound=500&Nao=24"
      }
    },
    "related_queries": [
      {
        "query": "cordless milwaukee hammer drill"
      },
      {
        "query": "dewalt cordless drill"
      },
      {
        "query": "milwaukee drill"
      }
    ],
    "location_info": {
      "store_id": "121",
      "store_name": "Cumberland",
      "zipcode": "30339"
    },
    "breadcrumbs": [
      {
        "name": "Tools",
        "link": "https://www.homedepot.com/b/Tools/N-5yc1vZc1xy/Ntk-elasticplus/Ntt-milwaukee%2Bcordless%2Bdrill?NCNI-5"
      },
      {
        "name": "Power Tools",
        "link": "https://www.homedepot.com/b/Tools-Power-Tools/N-5yc1vZc298/Ntk-elasticplus/Ntt-milwaukee%2Bcordless%2Bdrill?NCNI-5"
      }
    ],
    "facets": [
      {
        "name": "Brand",
        "display_name": "Brand",
        "values": [
          {
            "display_name": "Milwaukee",
            "value": "zv",
            "link": "https://www.homedepot.com/b/Tools-Power-Tools/Milwaukee/N-5yc1vZc298Zzv/Ntk-elasticplus/Ntt-milwaukee%2Bcordless%2Bdrill?NCNI-5&lowerBound=100&upperBound=500",
            "count": 1167,
            "active": false
          },
          {
            "display_name": "DEWALT",
            "value": "4j2",
            "link": "https://www.homedepot.com/b/Tools-Power-Tools/DEWALT/N-5yc1vZc298Z4j2/Ntk-elasticplus/Ntt-milwaukee%2Bcordless%2Bdrill?NCNI-5&lowerBound=100&upperBound=500",
            "count": 174,
            "active": false
          }
        ]
      },
      {
        "name": "Price",
        "display_name": "Price",
        "values": [
          {
            "display_name": "$100 - $150",
            "value": "12l3",
            "link": "https://www.homedepot.com/b/Tools-Power-Tools/N-5yc1vZc298Z12l3/Ntk-elasticplus/Ntt-milwaukee%2Bcordless%2Bdrill?NCNI-5&lowerBound=100&upperBound=500",
            "count": 118,
            "active": false
          },
          {
            "display_name": "$150 - $200",
            "value": "12l4",
            "link": "https://www.homedepot.com/b/Tools-Power-Tools/N-5yc1vZc298Z12l4/Ntk-elasticplus/Ntt-milwaukee%2Bcordless%2Bdrill?NCNI-5&lowerBound=100&upperBound=500",
            "count": 182,
            "active": false
          }
        ]
      }
    ]
  }
}
```


---

# 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-search-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.
