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
Live API Demo
🔒 Sign in to try it live
Log in to call this API with your own API key. New accounts get 100 free credits — no card required.
Log in / Sign upNo active API key found. Create one in your Dashboard, then reload this page. Dashboard →
/api/project/idealista/get-sublocations 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'
Query Result
Use Cases
- Partition a large city into districts so that each follow-up listing search stays within a manageable page count.
- Build a neighborhood rent heatmap by running the same filtered search once for every sublocation returned here.
- Fill a district dropdown that appears after a user picks a city in a relocation or house-hunting tool.
- Compare the supply of one property type across barrios to spot under-served areas for investment or expansion.
- Crawl a country's place hierarchy level by level, following the divisible flag, to maintain an internal location catalog for a proptech product.
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.