> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenrows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the Zillow Discovery API

> Search Zillow real estate listings and extract structured property results including prices and details with the ZenRows Discovery API.

Easily extract search results from Zillow, including a comprehensive list of properties, their details, and pagination links for navigating through search results, such as:

* The total number of results for your search query.
* A list of properties with details:
  * Address (full street, city, state, and ZIP code).
  * Dimensions (size of the property in square feet).
  * Number of bedrooms and bathrooms.
  * Price, including currency and symbol.
  * Direct links to individual property listings.
* The search query used and its corresponding title.

## Supported Query Parameters

| PARAMETER | TYPE           | DEFAULT | DESCRIPTION                                                                                                                    |
| --------- | -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **url**   | `string <uri>` |         | The URL where the desired property data must be retrieved from. Example: `https://www.zillow.com/ks/?searchQueryState=%7B%7D`. |

### How to Setup

Request the search endpoint with your desired query:

```bash theme={null}
https://realestate.api.zenrows.com/v1/targets/zillow/discovery?url={url}&apikey=YOUR_ZENROWS_API_KEY
```

### Example

```bash cURL theme={null}
curl "https://realestate.api.zenrows.com/v1/targets/zillow/discovery?apikey=YOUR_ZENROWS_API_KEY&url=https://www.zillow.com/ks/?searchQueryState=%7B%7D"  # URL-encoded search query
```

<Note>The URL search query must be encoded.</Note>

<RequestExample>
  ```python Python theme={null}
  # pip install requests
  import requests

  url = 'https://www.zillow.com/ks/?searchQueryState=%7B%7D'
  apikey = 'YOUR_ZENROWS_API_KEY'
  params = {
      'apikey': apikey,
      'url': url,
  }

  response = requests.get('https://realestate.api.zenrows.com/v1/targets/zillow/discovery/', params=params)
  print(response.text)
  ```

  ```javascript NodeJS theme={null}
  // npm install axios
  const axios = require('axios');

  const url = 'https://www.zillow.com/ks/?searchQueryState=%7B%7D';
  const apikey = 'YOUR_ZENROWS_API_KEY';

  axios
      .get('https://realestate.api.zenrows.com/v1/targets/zillow/discovery/', {
          params: {
              apikey,
              url,
          },
      })
      .then((response) => console.log(response.data))
      .catch((error) => console.log(error));
  ```

  ```java Java theme={null}
  import org.apache.hc.client5.http.fluent.Request;
  import org.apache.hc.core5.net.URIBuilder;
  import java.net.URI;

  public class ZRRequest {
      public static void main(final String... args) throws Exception {
          String url = "https://www.zillow.com/ks/?searchQueryState=%7B%7D";
          String apikey = "YOUR_ZENROWS_API_KEY";

          URI uri = new URIBuilder("https://realestate.api.zenrows.com/v1/targets/zillow/discovery/")
              .addParameter("apikey", apikey)
              .addParameter("url", url)
              .build();

          String response = Request.get(uri)
              .execute().returnContent().asString();

          System.out.println(response);
      }
  }
  ```

  ```php PHP theme={null}
  <?php
  $apikey = 'YOUR_ZENROWS_API_KEY';
  $url = 'https://www.zillow.com/ks/?searchQueryState=%7B%7D';
  $params = [
      'apikey' => $apikey,
      'url' => $url,
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://realestate.api.zenrows.com/v1/targets/zillow/discovery/?' . http_build_query($params));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

  $response = curl_exec($ch);
  echo $response . PHP_EOL;
  curl_close($ch);
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"
      "io/ioutil"
      "net/http"
      "net/url"
  )

  func main() {
      apikey := "YOUR_ZENROWS_API_KEY"
      url := "https://www.zillow.com/ks/?searchQueryState=%7B%7D"
      params := url.Values{}
      params.Add("apikey", apikey)
      params.Add("url", url)

      resp, err := http.Get("https://realestate.api.zenrows.com/v1/targets/zillow/discovery/?" + params.Encode())
      if err != nil {
          log.Fatalln(err)
      }
      defer resp.Body.Close()

      body, err := ioutil.ReadAll(resp.Body)
      if err != nil {
          log.Fatalln(err)
      }

      fmt.Println(string(body))
  }
  ```

  ```ruby Ruby theme={null}
  # gem install faraday
  require 'faraday'

  apikey = 'YOUR_ZENROWS_API_KEY'
  url = 'https://www.zillow.com/ks/?searchQueryState=%7B%7D'

  conn = Faraday.new(url: 'https://realestate.api.zenrows.com/v1/targets/zillow/discovery/') do |f|
  f.params = {
      apikey: apikey,
      url: url,
  }
  end

  response = conn.get

  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example theme={null}
  {
      "number_of_results": 8000,
      "property_list": [
          {
              "address": "123 Main St, New York, NY 10001",
              "dimensions": 1000,
              "number_of_bathrooms": 2,
              "number_of_bedrooms": 2,
              "price_currency_code": "USD",
              "price_currency_symbol": "$",
              "property_url": "https:\/\/www.zillow.com\/homedetails\/10314-W-Deanne-Dr-Sun-City-AZ-85351\/7694235_zpid\/"
          }
      ],
      "query": "houses for sale in New York",
      "search_title": "New York"
  }
  ```
</ResponseExample>
