Search Urbania listings for sale, rent or temporary rent in Peru. Filter by place, property type, price with its currency, bedrooms, bathrooms and covered area, sort by price, date or views and page through the results. Each item has all prices in soles and dollars, fees, bedrooms, bathrooms, areas, parking, address, coordinates, photos, highlights and the advertiser. A page holds up to 30 listings. Development projects appear in every search without room counts and carry is_project true; set exclude_projects to remove them. Every returned item satisfies the filters you set, and data.excluded counts items removed by exclude_projects or by the price check. A valid search with no match is a successful response with an empty list. A page past the last page returns an empty list. An unknown place is a 422 error.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
This endpoint has no required query parameters.
14 optional filters available.
string
Optional
sale, rent or temporary. Defaults to sale.
sale
string
Optional
all, apartment, house, land, office or commercial. Defaults to all.
apartment
string
Optional
Place slug from the slug field of /autocomplete, for example miraflores--lima--lima. Without it the search covers all of Peru.
miraflores--lima--lima
integer
Optional
Lowest price in the chosen currency.
200000
integer
Optional
Highest price in the chosen currency.
400000
string
Optional
PEN or USD for the price filter. Defaults to PEN.
USD
integer
Optional
Fewest bedrooms.
2
integer
Optional
Most bedrooms.
10
integer
Optional
Fewest bathrooms.
10
integer
Optional
Smallest covered area in square metres.
10
integer
Optional
Largest covered area in square metres.
10
string
Optional
relevance, price_asc, price_desc, newest, most_viewed or price_drop. Price sorts use the price in soles. Defaults to relevance.
relevance
boolean
Optional
true removes development projects, which have no room counts. Defaults to false.
true
integer
Optional
One-based page number. Defaults to 1.
1
Request Examples
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1",
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
use Illuminate\Support\Facades\Http;
$response = Http::timeout(30)
->withHeaders(['x-api-key' => 'YOUR_API_KEY_HERE'])
->get('https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1');
if ($response->successful()) {
echo $response->body();
} else {
echo "Error: " . $response->status();
}
const options = {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE'
}
};
fetch('https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1', 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));
const axios = require('axios');
const options = {
method: 'GET',
url: 'https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1',
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);
}
require 'net/http'
require 'uri'
uri = URI.parse("https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1")
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
import http.client
import json
conn = http.client.HTTPSConnection("scrappa.co")
headers = {
'x-api-key': 'YOUR_API_KEY_HERE',
}
try:
conn.request("GET", "/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
except Exception as e:
print(f"Error: {e}")
finally:
conn.close()
import requests
headers = {
'x-api-key': 'YOUR_API_KEY_HERE',
}
try:
response = requests.get('https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1', headers=headers)
response.raise_for_status()
print(response.text)
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
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/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1")
.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());
}
}
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1", 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))
}
#!/bin/bash
curl -X GET \
-H "x-api-key: YOUR_API_KEY_HERE" \
"https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1"
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/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1"));
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
import axios from 'axios';
async function run(): Promise<void> {
try {
const response = await axios({
method: 'GET',
url: 'https://scrappa.co/api/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
},
});
console.log(response.data);
} catch (error) {
console.error('Error:', error);
}
}
void run();
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/urbania/search?operation=sale&property_type=apartment&location=miraflores--lima--lima&bedrooms_min=2&price_min=200000&price_max=400000¤cy=USD&exclude_projects=1")
.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
{
"success": true,
"data": {
"items": [
{
"id": 151143469,
"code": "Sociedad Lu",
"url": "https://urbania.pe/inmueble/clasificado/veclapin-venta-de-departamento-en-barrio-medico-miraflores-3-dormitorios-151143469",
"title": "Flat Moderno en Barrio Medico Limite con La Aurora",
"summary": "Departamento \u00b7 104m\u00b2 \u00b7 3 Dormitorios \u00b7 2 Estacionamientos",
"operation": "sale",
"prices": [
{
"currency": "PEN",
"amount": 702000,
"formatted": "702,000",
"symbol": "S/"
},
{
"currency": "USD",
"amount": 208000,
"formatted": "208,000",
"symbol": "USD"
}
],
"expenses": {
"currency": "PEN",
"amount": 500,
"formatted": "500",
"symbol": "S/"
},
"property_type": "Departamentos",
"is_project": false,
"bedrooms": 3,
"bathrooms": 2,
"half_bathrooms": 1,
"parking": 2,
"area_total": 103,
"area_covered": 104,
"age_years": 10,
"location": {
"address": "Calle V\u00edctor Maurtua 166",
"latitude": -12.11,
"longitude": -77.05
},
"publisher": {
"id": 102453971,
"name": "LA VILLA NUEVA",
"type": "agency"
}
}
],
"page": 1,
"per_page": 30,
"total": 833,
"total_pages": 28,
"has_more": true,
"excluded": {
"projects": 15,
"price_mismatch": 0
}
},
"meta": {
"endpoint_family": "search",
"billable": true
}
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
A public parameter is missing or invalid, or the location cannot be resolved. The response is not billable.
{
"errors": {
"sort": [
"The selected sort is invalid."
]
},
"message": "The request validation failed"
}Resource Not Found
No Urbania resource matches the request. The response is not billable.
{
"meta": {
"billable": false,
"retryable": false,
"endpoint_family": "search"
},
"error": {
"code": "NOT_FOUND",
"message": "The requested Urbania resource was not found."
},
"success": false
}Unexpected Upstream Response
Urbania answered with a page in an unexpected format. The response is not billable.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "search"
},
"error": {
"code": "PARSER_DRIFT",
"message": "Urbania returned a page in an unexpected format. Please retry later."
},
"success": false
}Upstream Unavailable
Urbania was temporarily unavailable or blocked the request. The response is not billable and the request never answers 429.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "search"
},
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "The Urbania API is temporarily unavailable. Please retry."
},
"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.