v1.0.0

4U Real Estate API

Public API for accessing property listings in Saint Martin. Integrate our real estate data directly into your website.

Base URL: https://listings.4u-realestate.org
Auth: API Key (x-api-key)
Format: JSON
Rate Limit: 100 req/min

🔐 Authentication

API Key Required

All requests to /properties endpoints require a valid API key sent via the x-api-key header. Contact us to obtain your key.

curl -H "x-api-key: YOUR_API_KEY" https://listings.4u-realestate.org/properties

Without a valid API key, all requests will return a 401 Unauthorized error. Contact us at contact@4u-realestate.org to obtain your key.

📡 Endpoints

GET /properties List properties with filters & pagination

Retrieve a paginated list of published properties. Supports full-text search, filtering, and sorting.

PARAMETERS

NameTypeDescription
pagenumberPage number (default: 1)
limitnumberResults per page (default: 20, max: 100)
searchstringFull-text search on title & description
featuredbooleanFilter featured properties
projectstringFilter by project name
propertyTypestringFilter by type (apartments, villas, penthouses...)
purposestringFilter by purpose (for-rent, for-sale, vacation-rentals...)
citystringFilter by city
areastringFilter by area/neighborhood
countrystringFilter by country
minPricenumberMinimum price
maxPricenumberMaximum price
minBedroomsnumberMinimum bedrooms
maxBedroomsnumberMaximum bedrooms
languagestringLanguage filter (en, fr)
sortstringprice_asc, price_desc, newest, oldest (default: title)

Example Request

curl -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties?page=1&limit=10&purpose=vacation-rentals"

Example Response

{
  "success": true,
  "properties": [ { "title": "...", "price": 150, ... } ],
  "total": 179,
  "page": 1,
  "limit": 10,
  "totalPages": 18
}
GET /properties/featured Get featured properties

Retrieve properties marked as featured (highlighted listings).

NameTypeDescription
limitnumberMax results (default: 10, max: 50)
purposestringFilter by purpose

Example

curl -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/featured?limit=6"
GET /properties/stats Get public statistics

Get aggregated stats: total count, available purposes, property types, and cities.

Example Response

{
  "success": true,
  "stats": {
    "totalProperties": 179,
    "purposes": ["for-rent", "for-sale", "vacation-rentals"],
    "propertyTypes": ["apartments", "villas", "penthouses"],
    "cities": ["Simpson Bay", "Maho"]
  }
}
GET /properties/by-slug/:slug Get property by URL slug
NameTypeDescription
slugstringURL slug of the property (required)

Example

curl -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/by-slug/luxury-2br-apartment-ocean-view"
GET /properties/by-lodgify/:lodgifyId Get property by Lodgify ID
NameTypeDescription
lodgifyIdnumberLodgify rental ID (required)

Example

curl -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/by-lodgify/499029"
GET /properties/:id Get full property details

Retrieve the complete details of a single property by its MongoDB ID.

Example

curl -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/664f1a2b3c4d5e6f7a8b9c0d"

💻 Code Examples

JavaScript
PHP
Python
cURL
const API_URL = 'https://listings.4u-realestate.org';
const API_KEY = 'YOUR_API_KEY';

const headers = { 'x-api-key': API_KEY };

// List properties
const res = await fetch(`${API_URL}/properties?limit=10&purpose=vacation-rentals`, { headers });
const data = await res.json();

console.log(`Total: ${data.total} properties`);
data.properties.forEach(p => {
  console.log(`  ${p.title} - $${p.price}/${p.priceUnit}`);
});

// Get single property
const detail = await fetch(`${API_URL}/properties/${data.properties[0]._id}`, { headers });
const property = await detail.json();
$API_URL = 'https://listings.4u-realestate.org';
$API_KEY = 'YOUR_API_KEY';

$ch = curl_init("$API_URL/properties?limit=10&purpose=vacation-rentals");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'x-api-key: ' . $API_KEY,
    'Accept: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
echo "Total: " . $data['total'] . " properties\n";

foreach ($data['properties'] as $p) {
    echo "  {$p['title']} - ${$p['price']}/{$p['priceUnit']}\n";
}
import requests

API_URL = 'https://listings.4u-realestate.org'
API_KEY = 'YOUR_API_KEY'
HEADERS = {'x-api-key': API_KEY}

# List properties
res = requests.get(f'{API_URL}/properties', params={
    'limit': 10, 'purpose': 'vacation-rentals'
}, headers=HEADERS)

data = res.json()
print(f"Total: {data['total']} properties")

for p in data['properties']:
    print(f"  {p['title']} - ${p['price']}/{p['priceUnit']}")
# List properties
curl -s -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties?limit=10" | jq .

# Featured
curl -s -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/featured?limit=6" | jq .

# Stats
curl -s -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/stats" | jq .

# By slug
curl -s -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/by-slug/my-property" | jq .

# By ID
curl -s -H "x-api-key: YOUR_KEY" \
  "https://listings.4u-realestate.org/properties/PROPERTY_ID" | jq .

📋 Property Fields

FieldTypeDescription
_idstringUnique MongoDB ID
title / title_frstringProperty title (EN / FR)
slugstringURL-friendly identifier
description / description_frstringFull HTML description (EN / FR)
shortDescriptionstringShort summary
statusstringAlways "published" on public API
featuredbooleanHighlighted listing
pricenumberProperty price
priceUnitstringper_night, per_month, total
currencystringCurrency code (USD)
surfacenumberArea in sqm
bedroomsnumberNumber of bedrooms
bathroomsnumberNumber of bathrooms
featuredImageobjectMain image {url, alt}
galleryarrayAll images [{url, alt, order}]
addressobjectLocation {street, city, country, lat, lng}
rentalIdnumberLodgify rental ID
purposesarrayProperty purposes taxonomy
propertyTypesarrayProperty types taxonomy

⚠️ Error Codes

CodeMeaningSolution
401Missing or invalid API keyAdd a valid x-api-key header
403API key disabled or expiredContact admin to reactivate
404Property not foundCheck the ID or slug
429Rate limit exceededWait and retry, cache results
500Server errorContact contact@4u-realestate.org