Skip to content
Scrappa Get API key
Pisos.com API 1 credit/request

Pisos.com Property Search API Documentation

GET https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc

Scrappa's GET /api/pisos/search returns Pisos.com property for sale or rent in one Spanish location as structured JSON.

What you get

One request returns one page of up to 30 listings and Pisos.com's own match count in pagination.total. Each item has id, listing_id, url, title, location, operation, property_type, price in EUR, price_period (month for rent, day or week for holiday lets, null for sale), bedrooms, bathrooms, area_m2, floor, description, photo_count, image, latitude, longitude, locality, region, agency (none for private sellers), is_new_development and is_promoted. Call the listing endpoint for features, energy certificate and the whole photo gallery.

Filters are honoured

Bedrooms, bathrooms, minimum size, minimum price, features and sort are applied by Pisos.com. Bedrooms, bathrooms and min_size mean "this many or more", verified live. Pisos.com treats the upper price bound loosely, so min_price, max_price, bedrooms, bathrooms and min_size are checked again on every item. A value that the item shows and that breaks the filter removes the item. An item that shows no value for that field is kept, because Pisos.com already filtered it. Features cannot be checked again, because items carry no feature list, so they rely on Pisos.com. Items that break a filter are removed and counted in items_dropped. Holiday lets priced per day or week cannot be compared with a range, so they are removed too when a price filter is set. pagination.total stays Pisos.com's count, and total_includes_dropped says when it contains removed items. A page can therefore hold fewer than 30 items. Unknown parameters and unknown values are rejected with 422.

Location and type

location is the location value from /api/pisos/autocomplete. property_type is one of pisos, casas, aticos, duplex, estudios, locales, garajes, terrenos, and habitaciones for rent only.

Pagination

page is 1-based. A page past the last page returns an empty list with has_next_page false. It never returns another page's listings under that page number.

Sort

relevance (default), newest, price_asc, price_desc, bedrooms_asc, bedrooms_desc, size_asc or size_desc.

Pisos.com Property Search API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc
Auth header
x-api-key
Cost
1 credit/request
location = madrid
Response preview
200 OK
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "65098413759",
                "listing_id": "65098413759.100500",
                "url": "https://www.pisos.com/comprar/piso-gaztambide-65098413759_100500/",
                "path": "/comprar/piso-gaztambide-65098413759_100500/",
                "title": "Piso en calle de la Princesa, 76",
                "location": "Gaztambide (Distrito Chamber\u00ed. Madrid Capital)",
                "operation": "sale",
                "property_type": "piso",
                "price": 1600000,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

12 optional filters available.

location string Required

Location name from the autocomplete endpoint, for example madrid or alcala_de_henares.

Example value madrid
operation string Optional

sale (default) or rent.

Example value sale
property_type string Optional

pisos (default), casas, aticos, duplex, estudios, locales, garajes, terrenos or habitaciones (rent only).

Example value pisos
min_price integer Optional

Minimum price in EUR (monthly rent for rent).

Example value 10
max_price integer Optional

Maximum price in EUR. Checked again on every item.

Example value 400000
bedrooms integer Optional

Bedrooms, this many or more, 1 to 6. Checked on every item.

Example value 3
bathrooms integer Optional

Bathrooms, this many or more, 1 to 5. Checked on every item.

Example value 10
min_size integer Optional

Minimum area in m2. Checked on every item.

Example value 10
features string Optional

One or more of terrace, elevator, garden, pool, parking, heating, air_conditioning. Repeat as features[] or comma-separate.

Example value example
has_photo boolean Optional

true to return listings with photos only.

Example value true
reduced_price boolean Optional

true to return listings with a reduced price only.

Example value true
sort string Optional

relevance (default), newest, price_asc, price_desc, bedrooms_asc, bedrooms_desc, size_asc or size_desc.

Example value price_asc
page integer Optional

Result page, 1-based. A page holds up to 30 listings.

Example value 1

Request Examples

PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-api-key: YOUR_API_KEY_HERE"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
PHP
<?php

use Illuminate\Support\Facades\Http;

$response = Http::timeout(30)
    ->withHeaders(['x-api-key' => 'YOUR_API_KEY_HERE'])
    ->get('https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc');

if ($response->successful()) {
    echo $response->body();
} else {
    echo "Error: " . $response->status();
}
JavaScript
const options = {
    method: 'GET',
    headers: {
        'x-api-key': 'YOUR_API_KEY_HERE'
    }
};

fetch('https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc', options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        return response.text();
    })
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
JavaScript
const axios = require('axios');

const options = {
    method: 'GET',
    url: 'https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc',
    headers: {
        x-api-key: 'YOUR_API_KEY_HERE',
    }
};

try {
    const response = await axios(options);
    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
Ruby
require 'net/http'
require 'uri'

uri = URI.parse("https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'

request = Net::HTTP::Get.new(uri.request_uri)
request['x-api-key'] = 'YOUR_API_KEY_HERE'

begin
    response = http.request(request)
    puts response.body
rescue => e
    puts "Error: #{e.message}"
end
Python
import http.client
import json

conn = http.client.HTTPSConnection("scrappa.co")

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    conn.request("GET", "/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc", headers=headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
except Exception as e:
    print(f"Error: {e}")
finally:
    conn.close()
Python
import requests

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    response = requests.get('https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc', headers=headers)
    response.raise_for_status()
    print(response.text)
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
Java
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;

public class ApiExample {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc")
        .addHeader("x-api-key", "YOUR_API_KEY_HERE")
            .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                System.out.println(response.body().string());
            } else {
                System.out.println("Error: " + response.code());
            }
        } catch (IOException e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
Go
package main

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

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc", nil)
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }
    req.Header.Set("x-api-key", "YOUR_API_KEY_HERE")

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error making request:", err)
        return
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println("Error reading response:", err)
        return
    }

    fmt.Println(string(body))
}
Terminal
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc"
C#
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY_HERE");

        try
        {
            var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc"));
            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
    }
}
TypeScript
import axios from 'axios';

async function run(): Promise<void> {
    try {
        const response = await axios({
            method: 'GET',
            url: 'https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc',
            headers: {
        'x-api-key': 'YOUR_API_KEY_HERE',
            },
        });

        console.log(response.data);
    } catch (error) {
        console.error('Error:', error);
    }
}

void run();
RUST
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .get("https://scrappa.co/api/pisos/search?location=madrid&operation=sale&property_type=pisos&bedrooms=3&max_price=400000&sort=price_asc")
        .header("x-api-key", "YOUR_API_KEY_HERE")
        .send()
        .await?;

    println!("{}", response.text().await?);

    Ok(())
}

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

success data meta
JSON Response
200 OK
{
    "success": true,
    "data": {
        "items": [
            {
                "id": "65098413759",
                "listing_id": "65098413759.100500",
                "url": "https://www.pisos.com/comprar/piso-gaztambide-65098413759_100500/",
                "path": "/comprar/piso-gaztambide-65098413759_100500/",
                "title": "Piso en calle de la Princesa, 76",
                "location": "Gaztambide (Distrito Chamber\u00ed. Madrid Capital)",
                "operation": "sale",
                "property_type": "piso",
                "price": 1600000,
                "currency": "EUR",
                "price_period": null,
                "price_per_m2": null,
                "bedrooms": 3,
                "bathrooms": 3,
                "area_m2": 155,
                "floor": "4\u00aa planta",
                "description": "Espectacular propiedad de alta gama llave en mano...",
                "photo_count": 34,
                "image": "https://fotos.imghs.net/mm-wp/1005/101/photo.jpg",
                "latitude": 40.4325,
                "longitude": -3.71735,
                "locality": "Madrid Capital",
                "region": "Madrid",
                "agency": {
                    "id": "100500",
                    "slug": "princess_homes",
                    "url": "https://www.pisos.com/inmobiliaria-princess_homes/"
                },
                "is_new_development": false,
                "is_promoted": true,
                "tag": "Oportunidad",
                "listing_type": null
            }
        ],
        "pagination": {
            "page": 1,
            "per_page": 30,
            "total": 1402,
            "total_pages": 47,
            "has_next_page": true
        },
        "items_dropped": 0,
        "total_includes_dropped": false,
        "applied_filters": {
            "operation": "sale",
            "location": "madrid",
            "property_type": "pisos",
            "bedrooms": 3,
            "max_price": 400000,
            "sort": "price_asc"
        }
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true,
        "attempts": 1,
        "items_dropped": 0
    }
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

404

Not Found

Pisos.com has no results page for that location, type or filter combination (`NOT_FOUND`). Non-billable.

{
    "meta": {
        "billable": false,
        "retryable": false,
        "endpoint_family": "search"
    },
    "error": {
        "code": "NOT_FOUND",
        "message": "The requested resource was not found."
    },
    "success": false
}
422

Validation Error

A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable.

{
    "errors": {
        "sort": [
            "The selected sort is invalid."
        ]
    },
    "message": "The selected sort is invalid."
}
503

Upstream Unavailable

Pisos.com could not be reached, refused the request or answered with a page this API could not read (`UPSTREAM_UNAVAILABLE`). Retryable and never billed. Clients are never rate limited.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "search"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "Pisos.com could not be reached. Please retry shortly."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.