> ## 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 Idealista Property Data API

> Get detailed Idealista property information including price, location, features, and images using the ZenRows Property Data API endpoint.

The Idealista Property Data API provides tailored endpoints to extract comprehensive property details directly from Idealista. With this powerful tool, you can seamlessly integrate real estate data into your applications, enabling in-depth market analysis, reporting, or decision-making.

Easily extract detailed property information from Idealista. This endpoint provides everything you need to analyze or present Idealista property data effectively, such as:

* **Detailed Property Information:** Extract property specifics, including address, bedrooms, bathrooms, pricing, and more.
* **Agent and Agency Details:** Gather information about agencies or agents associated with listed properties, including agency name, logo, and contact information.
* **Geolocation Data:** Retrieve latitude and longitude for properties to integrate with mapping tools.
* **Images and Features:** Access property images and a list of unique features to enhance your data presentations.
* **Dynamic Status Updates:** Ensure up-to-date information with the latest property status, modification dates, pricing, and deactivate dates when applicable.

## Supported Query Parameters

| PARAMETER                 | TYPE     | DEFAULT                            | DESCRIPTION                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | -------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **propertyId** `required` | `string` |                                    | The Unique ID of the Idealista property. Example: `1234567890`.                                                                                                                                                                                                                                                                             |
| **url**                   | `string` |                                    | The URL from which the desired property data will be retrieved. Example: `https://www.idealista.com/inmueble/1234567890`.                                                                                                                                                                                                                   |
| **tld**                   | `string` | `.com`                             | The top-level domain of the Idealista website. Supported examples: `.com`, `.it` `.pt`                                                                                                                                                                                                                                                      |
| **lang**                  | `string` | **Language of the target country** | The language to display results. Supported values: `"en"`, `"es"`, `"ca"`, `"it"`, `"pt"`, `"fr"`, `"de"`, `"da"`, `"fi"`, `"nb"`, `"nl"`, `"pl"`, `"ro"`, `"ru"`, `"sv"`, `"el"`, `"zh"`, `"uk"`. The default is the language of the target country (e.g., `"es"` for `.com`, `"it"` for `.it`, and `"pt"` for `.pt`). Example: `lang=en`. |

### How to Setup

Fetch details for a property using its PropertyID.

```bash theme={null}
https://realestate.api.zenrows.com/v1/targets/idealista/properties/{propertyId}?apikey=YOUR_ZENROWS_API_KEY
```

### Example

```bash cURL theme={null}
curl "https://realestate.api.zenrows.com/v1/targets/idealista/properties/{propertyId}?apikey=YOUR_ZENROWS_API_KEY"
```

<Note>Replace `{propertyId}` with the actual property ID code.</Note>

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

  property_id = "1234567890"  # Example property ID
  api_endpoint = f"https://realestate.api.zenrows.com/v1/targets/idealista/properties/{property_id}"
  params = {
      "apikey": "YOUR_ZENROWS_API_KEY",
  }
  response = requests.get(api_endpoint, params=params)
  print(response.text)
  ```

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

  const propertyId = "1234567890"; // Example property ID
  const api_endpoint = `https://realestate.api.zenrows.com/v1/targets/idealista/properties/${propertyId}`;
  const apikey = 'YOUR_ZENROWS_API_KEY';

  axios
      .get(api_endpoint, {
          params: { apikey },
      })
      .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 propertyId = "1234567890"; // Example property ID
          String api_endpoint = "https://realestate.api.zenrows.com/v1/targets/idealista/properties/" + propertyId;
          String apikey = "YOUR_ZENROWS_API_KEY";

          URI uri = new URIBuilder(api_endpoint)
              .addParameter("apikey", apikey)
              .build();

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

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

  ```php PHP theme={null}
  <?php
  $propertyId = "1234567890"; // Example property ID
  $api_endpoint = "https://realestate.api.zenrows.com/v1/targets/idealista/properties/" . $propertyId;
  $apikey = 'YOUR_ZENROWS_API_KEY';
  $params = [
      'apikey' => $apikey
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $api_endpoint . '?' . 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"
      "log"
      "net/http"
      "net/url"
  )

  func main() {
      propertyId := "1234567890" // Example property ID
      api_endpoint := "https://realestate.api.zenrows.com/v1/targets/idealista/properties/" + propertyId
      apikey := "YOUR_ZENROWS_API_KEY"
      params := url.Values{}
      params.Add("apikey", apikey)

      resp, err := http.Get(api_endpoint + "?" + 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'

  property_id = "1234567890" # Example property ID
  api_endpoint = "https://realestate.api.zenrows.com/v1/targets/idealista/properties/#{property_id}"
  apikey = 'YOUR_ZENROWS_API_KEY'

  conn = Faraday.new(url: api_endpoint) do |f|
  f.params = {
      apikey: apikey
  }
  end

  response = conn.get

  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example theme={null}
  {
      "property_id": 1234567890,
      "address": "Calle de Alcalá, Madrid",
      "latitude": 40.423,
      "longitude": -3.683,
      "location_name": "Madrid",
      "location_hierarchy": ["Madrid", "Centro", "Sol"],
      "country": "es",
      "agency_name": "Best Properties Madrid",
      "agency_phone": "+34 912 345 678",
      "agency_logo": "https://example.com/logo.png",
      "bathroom_count": 2,
      "lot_size": 120,
      "operation": "sale",
      "price_currency_symbol": "€",
      "property_condition": "good",
      "property_description": "Bright and spacious apartment located in the heart of Madrid, fully renovated with modern finishes.",
      "property_equipment": [
          "Air Conditioning",
          "Heating",
          "Elevator",
          "Furnished Kitchen"
      ],
      "property_features": [
          "Terrace",
          "Exterior",
          "Balcony",
          "Built-in wardrobes"
      ],
      "property_images": [
          "https://example.com/image1.jpg",
          "https://example.com/image2.jpg",
          "https://example.com/image3.jpg"
      ],
      "property_image_tags": [
          "facade",
          "living room",
          "kitchen"
      ],
      "energy_certificate": "D",
      "modified_at": 1714078923,
      "last_deactivated_at": null
      }
  ```
</ResponseExample>

## Response Structure

Depending on the property status (active or inactive), the returned fields may vary:

1. **For Active Listings:** <br />Full property details are returned, including address, price, features, images, geolocation, agency details, and more.

2. **For Inactive Listings:** <br />Only a subset of fields will be present: <br />

   | FIELD                 | DESCRIPTION                                             |
   | --------------------- | ------------------------------------------------------- |
   | `property_id`         | Unique identifier of the property.                      |
   | `last_deactivated_at` | Timestamp indicating when the listing was deactivated.  |
   | `operation`           | Operation type (e.g., sale, rent).                      |
   | `agency_name`         | Name of the agency if the listing was published by one. |
   | `agency_logo`         | Logo URL of the agency if available.                    |

## Troubleshooting and FAQs

<Accordion title="How do I get the correct propertyId?">
  You can retrieve the `propertyId` from the URL of the property listing on Idealista. For example, the URL `https://www.idealista.com/inmueble/1234567890` contains the propertyId as `1234567890`.
</Accordion>

<Accordion title="What happens if a property is no longer available?">
  If a property is inactive, the `last_deactivated_at` field will be populated with a Unix timestamp. Some fields like images or descriptions might also be missing when a property is no longer active.
</Accordion>

<Accordion title="What format is used for modified_at and last_deactivated_at?">
  Both `modified_at` and `last_deactivated_at` use Unix timestamps, representing the number of seconds since January 1, 1970 (UTC).
</Accordion>

<Accordion title="What is the difference between property_features and property_equipment?">
  `property_features` lists characteristics of the property such as "Terrace" or "Balcony", while `property_equipment` lists available equipment and amenities like "Air Conditioning" or "Elevator".
</Accordion>

<Accordion title="What is included in property_images and property_image_tags?">
  `property_images` provides direct URLs to the property's photos. `property_image_tags` gives context to each image, indicating what the photo shows (e.g., "facade", "kitchen").
</Accordion>

<Accordion title="Can a property have no energy_certificate value?">
  Yes, if the property does not have an energy certificate available, the `energy_certificate` field may be null or missing.
</Accordion>

<Accordion title="What is the meaning of the operation field?">
  The `operation` field indicates if the property is listed for "sale" or "rent".
</Accordion>

<Accordion title="How can I know the property's location details?">
  The `address`, `latitude`, `longitude`, `location_name`, `location_hierarchy`, and `country` fields together provide complete information about the property's location.
</Accordion>

<Accordion title="What should I expect if I request a recently updated property?">
  If a property was updated recently, you will get the latest data, and the `modified_at` timestamp will reflect the most recent modification time.
</Accordion>

<Accordion title="What does the agency_logo field contain?">
  The `agency_logo` field contains a direct URL to the logo image of the real estate agency managing the property.
</Accordion>
