Démarrage
Démarrage rapide
Votre premier appel à l'API Stream Estate
Une fois authentifié, lançons une recherche.
Rechercher des propriétés
Le point d'entrée de la recherche est POST /properties avec un corps JSON construit autour d'un arbre criteria (voir Filtrage) :
curl -X POST "https://api-v2.stream.estate/properties" \
-H "X-API-KEY: <votre_clé>" \
-H "Content-Type: application/json" \
-d '{
"criteria": {
"property": {
"type": { "in": ["FLAT"] },
"transaction": { "type": "SELL" },
"pricing": { "displayed": { "gte": 200000, "lte": 500000 } },
"unit": { "rooms": { "gte": 3 } },
"locations": {
"countryCode": "FR",
"in": { "uniqueCodes": ["75056"] }
}
}
},
"paginationType": "PAGE",
"page": 1,
"size": 10
}'const res = await fetch("https://api-v2.stream.estate/properties", {
method: "POST",
headers: {
"X-API-KEY": process.env.STREAM_ESTATE_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
criteria: {
property: {
type: { in: ["FLAT"] },
transaction: { type: "SELL" },
pricing: { displayed: { gte: 200000, lte: 500000 } },
},
},
paginationType: "PAGE",
page: 1,
size: 10,
}),
});
const data = await res.json();
console.log(data.items, data.totalItems);L'API supporte JSON (application/json) ou JSON:API (application/vnd.api+json) selon l'en-tête Accept.
Récupérer une property précise
curl "https://api-v2.stream.estate/properties/<uuid>" \
-H "X-API-KEY: <votre_clé>"Prochaines étapes
- Filtrage — composer un arbre
criteriaavecand/or - Pagination — modes
PAGEetCURSOR - Alert — sauvegarder une recherche et recevoir des notifications