Filtering
Compose a criteria tree for POST /properties
The POST /properties body is built around a single criteria field — a recursive tree where every node takes exactly one of three shapes:
- a
Filtersleaf (a flat bag of facet filters — the most common case); - an AND node
{ "and": [/* children */] }— all children must match; - an OR node
{ "or": [/* children */] }— at least one child must match.
Omit criteria entirely to match every property.
Body shape
{
"criteria": { /* CriteriaNode */ },
"paginationType": "PAGE",
"page": 1,
"size": 20
}| Field | Type | Value |
|---|---|---|
criteria | CriteriaNode | null | A Filters leaf, an and node, or an or node. |
paginationType | enum | "PAGE" (default) or "CURSOR". See Pagination. |
page | integer | Honored only in PAGE mode. Default 1, minimum 1. |
cursor | string | null | Honored only in CURSOR mode. Echo back the value from the previous response. |
size | integer | 0–100. Default 10. With 0, the response carries no property, only their count: see Count without fetching properties. |
sort | object | Sort directive (field + direction). |
The Filters leaf
A leaf groups filters by facet (all AND-ed together inside the leaf):
| Facet | Schema | Targets |
|---|---|---|
property | PropertyFacetFilters | type, transaction, constructionStatus, pricing, areas, locations, unit, building, amenities, body. |
publisher | PublisherFilters | type, mandate, references, hasEmail, hasPhone (all clauses apply to the same publisher). |
listings | ListingsFilters | sources, marketing, expiredAt, priceCoherent (all clauses apply to the same listing, except priceCoherent, which is judged at the property level). |
dates | DatesFilters | createdAt, updatedAt. |
For the full list of nested fields per facet (e.g. property.pricing.displayed, property.areas.displayed, property.unit.rooms, property.locations.in, …), see /api-reference — the reference is regenerated from the live spec on every build.
Default masks
Three populations are excluded from results until the matching filter is set:
- Expired listings — hidden by default. Setting
listings.expiredAtincludes them (narrowed to the requested range if bounds are given). - Incoherent prices — properties whose listings all carry a price judged incoherent with the local market are hidden by default:
listings.priceCoherentis implicitlytrue. Sendfalseto return only those properties. A property whose price cannot be judged stays visible either way. - New-build and under-construction properties — hidden by default: only old properties (
OLD) and those whose status is not known yet are returned. Aproperty.constructionStatusfilter holding at least one value (in,ninorinOrMissing), in any branch of the tree, lifts this mask for the whole search. An empty filter ({"in": []}) counts as absent. To get every property back:{"inOrMissing": ["OLD", "NEW", "UNDER_CONSTRUCTION"]}.
Alerts apply the incoherent-price and new-build masks, not the expired-listing one: an alert must be able to tell you a property left the market. See An alert's default scope.
Example — simple leaf
Flats for sale in Paris between €200k and €600k, 3–5 rooms, with a balcony:
curl -X POST "https://api-v2.stream.estate/properties" \
-H "X-API-KEY: <your_key>" \
-H "Content-Type: application/json" \
-d '{
"criteria": {
"property": {
"type": { "in": ["FLAT"] },
"transaction": { "type": "SELL" },
"pricing": { "displayed": { "gte": 200000, "lte": 600000 } },
"areas": { "displayed": { "gte": 50 } },
"unit": {
"rooms": { "gte": 3, "lte": 5 },
"features": { "in": ["BALCONY"] }
},
"locations": {
"countryCode": "FR",
"in": { "uniqueCodes": ["75056"] }
}
}
},
"paginationType": "PAGE",
"page": 1,
"size": 20
}'Location
property.locations filters on where the property is. Here, properties in Lyon or within 5 km of central Paris, except those in postal code 69009:
{
"criteria": {
"property": {
"locations": {
"countryCode": "FR",
"in": {
"uniqueCodes": ["69123"],
"centerPoint": { "latitude": 48.8566, "longitude": 2.3522, "radiusKm": 5 }
},
"nin": { "postalCodes": ["69009"] }
}
}
},
"size": 20
}ingroups five fields:ids,uniqueCodes,postalCodes,centerPointandgeoShapes. A property matches as soon as it matches any one of these fields (an OR), and any one of the shapes ingeoShapes.nintakes the same five fields and excludes every property matching any of them.accuracykeeps only the properties whose location has one of the listed accuracy levels, on top ofinandnin. Empty or absent, it filters nothing.countryCodeis the country of theuniqueCodesand applies to them only.uniqueCodessent withoutcountryCodeare ignored: aninholding only them no longer filters by location.
To require two fields at once, put each in its own leaf under an and node. Properties in Paris within 2 km of a point:
{
"criteria": {
"and": [
{ "property": { "locations": { "countryCode": "FR", "in": { "uniqueCodes": ["75056"] } } } },
{ "property": { "locations": { "in": { "centerPoint": { "latitude": 48.8606, "longitude": 2.3376, "radiusKm": 2 } } } } }
]
},
"size": 20
}Text search
property.body.title and property.body.description filter on the listing text. Each takes an object with two lists:
{
"criteria": {
"property": {
"body": {
"description": {
"in": ["à rénover", "travaux"],
"nin": ["bail commercial", "ehpad"]
}
}
}
},
"size": 20
}- Every entry is a phrase: its words must appear side by side, in that order.
"division possible"does not match a listing where the two words sit three paragraphs apart. A single word is a one-word phrase. - Case and accents are ignored:
"A RENOVER"and"à rénover"are the same query. in— the text must contain at least one of the phrases (an OR). To require two phrases at once, put one leaf per phrase inside anandnode.nin— the text must contain none of the phrases.- Up to 25 phrases per list. Both lists are optional.
A bare string ("description": "travaux") is refused with a 400. To get back what "division possible" used to return — either word — send { "in": ["division", "possible"] }; for the phrase, { "in": ["division possible"] }.
Energy certificate standard
property.unit.diagnostic.standard filters on the regulatory standard of the DPE: FR_DPE_2006 for a DPE established before 1 July 2021, FR_DPE_2021 from that date. Same clause triplet as unit.condition:
| Clause | Effect |
|---|---|
in | Strict: the standard must be in the list. Properties whose standard is unknown are excluded. |
nin | The standard must not be in the list. Properties whose standard is unknown pass. |
inOrMissing | The standard is in the list or unknown: keeps properties whose source did not state the standard. |
A value outside the list is refused with a 400 naming the accepted values. The criterion goes as is into an alert's criteria.
Properties rated A to C whose DPE follows the 2021 standard, or whose standard is not stated:
{
"criteria": {
"property": {
"unit": {
"diagnostic": {
"standard": { "inOrMissing": ["FR_DPE_2021"] },
"scores": [ { "type": "ENERGY_CONSUMPTION", "rating": ["A", "B", "C"] } ]
}
}
}
},
"size": 20
}AND / OR nodes
To combine several leaves, use and: or or: — each child is itself a CriteriaNode (so a leaf, another and, or another or). Each array holds between 2 and 10 child nodes, and nesting depth is not capped: to combine more than ten branches, nest another node.
{
"criteria": {
"or": [
{
"property": {
"type": { "in": ["FLAT"] },
"areas": { "displayed": { "gte": 60 } }
}
},
{
"property": {
"type": { "in": ["HOUSE"] },
"areas": { "displayed": { "gte": 100 }, "land": { "gte": 300 } }
}
}
]
},
"paginationType": "PAGE",
"size": 20
}How many children per node
An and or or array must hold at least 2 and at most 10 children. The rule is the same for both operators, and it applies to each node on its own. Outside those bounds the request is rejected with a 422:
| Children in the array | Result |
|---|---|
| 0 or 1 | 422 — or must contain at least 2 children (or and must contain at least 2 children) |
| 2 to 10 | accepted |
| 11 or more | 422 — or must contain at most 10 children (or and must contain at most 10 children) |
A node with a single child has no effect anyway — use the child directly. To combine more than ten branches, nest: depth itself is not capped.
{
"criteria": {
"or": [
{ "or": [ /* 10 branches */ ] },
{ "or": [ /* 10 more branches */ ] }
]
}
}Unknown keys
POST /properties refuses a key it does not know: nothing is searched and nothing is charged.
| Where | Response |
|---|---|
Inside criteria, at any depth: a facet, a filter, a child of and / or, or a facet written beside and / or on the same node | 422 naming the key: Unknown criteria attribute "uuid". |
At the top level of the body (filters instead of criteria), or inside sort (order instead of direction) | 400: Extra attributes are not allowed ("filters" is unknown). |
A 422 names the unknown keys of the first object that holds one; those of another facet or of another and / or child are reported once that one is fixed.
Response
In JSON:API format (default), properties are under data[], pagination under meta, and full listings / publishers under included:
{
"data": [ /* Property resources (type, id, attributes, relationships) */ ],
"meta": {
"totalItems": 1847,
"hasNextPage": true,
"cursor": "eyJzb3J0Ijpb..."
},
"links": { "self": "/properties" },
"included": [ /* Listing, Publisher, PropertyPublisher, Source */ ]
}meta.totalItems— total match count. InPAGEmode, it is capped at 10,000.meta.hasNextPage—trueif more results exist.meta.cursor— opaque, echo it back as-is in the next request inCURSORmode.nullinPAGEmode.
Each search result already contains the whole property: exactly the same content as GET /properties/{id} (property, publishers[], listings[]). There is no need to call GET /properties/{id} to complete a result; that call only serves to fetch a property whose id you already know.