List sublocations inside a divisible Idealista location, with listing totals per area

View all Idealista Property Listings API for Spain, Portugal & Italy endpoints →

Returns the child locations of a parent Idealista location, such as the districts or municipalities under a province, so you can drill down from a coarse place to a finer one. Send the country code (location: es, pt or it), the parent locationId (it must be a location flagged divisible=true, for example 0-EU-ES-28), and the operation and propertyType filters that decide which listings are counted in each child's total. The bedrooms property type only works together with the rent operation. In the recorded probe (location=es, locationId=0-EU-ES-28, operation=sale, propertyType=homes) the endpoint answered HTTP 200 with a JSON object holding a locations array and an integer total; each locations entry carried name, locationId, divisible, type, suggestedLocationId, subTypeText and an integer total. The endpoint returns places and counts only, never the property listings themselves.

API Features

Divisible-location drill-down Pass any locationId flagged divisible=true and receive its child areas; each child carries its own locationId, so you can walk the hierarchy one level at a time.
Filter-aware area totals The operation and propertyType inputs change the total on every returned area, so the counts reflect only sale or rent and only the property types you ask for.
Spain, Portugal and Italy hierarchies The location input selects the es, pt or it location tree, and the response keeps the same locations-plus-total shape in all three countries.
Identifiers and labels in one entry Every area is returned with name, locationId, type, subTypeText, the divisible flag and suggestedLocationId, enough to render a picker and to chain the next call without a second lookup.
Comma-separated multi-value filters The documented defaults combine sale,rent and all nine property types (homes through buildings), so one call can count everything or you can narrow it to a single type.

Live API Demo

GET /api/project/idealista/get-sublocations

Request cost is temporarily unavailable. No price is assumed.

View pricing

API Response (JSON)

{}
curl -X GET 'https://api.opendata-api.com/api/project/idealista/get-sublocations?key=<API_KEY>&location=es&locationId=<locationId>&operation=sale%2Crent&propertyType=homes%2CnewDevelopments%2Cbedrooms%2Coffices%2Cpremises%2Cgarages%2Clands%2CstorageRooms%2Cbuildings'
📢
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Contact Us

Use Cases

Frequently asked questions

Which locationId values can I pass to this endpoint?

Only locations flagged divisible=true can be expanded; the documented example is 0-EU-ES-28. Take IDs from a place-name lookup or from the locationId of an earlier sublocation response whose divisible field is true.

What do operation and propertyType change in the response?

They change the total field on each returned area so that it counts only listings with that operation and property type. The defaults are sale,rent and the nine types homes, newDevelopments, bedrooms, offices, premises, garages, lands, storageRooms and buildings. The bedrooms type only works with rent.

What does a successful response look like?

In the recorded probe the endpoint returned HTTP 200 with a JSON object containing a locations array and an integer total. Each locations entry had name, locationId, divisible, type, suggestedLocationId, subTypeText and total.

Which countries are supported?

The location input accepts es, pt or it. Use the matching country code together with a locationId from the same country.

Does this endpoint return the properties themselves?

No. It returns child locations with listing counts. Use the listing search endpoints of this API with the locationId you picked to retrieve the actual properties.

How do I go more than one level deep?

Call the endpoint again with the locationId of any returned area whose divisible value is true. Areas that are not divisible cannot be expanded further.

Related operations

Guides

View Subscription Plans →