# OpenUrbe > Official open data on each of Barcelona's 73 neighbourhoods (barris) and 10 > districts: rent, purchase prices, income per person, population, licensed > tourist flats and recorded offences. Figures are redistributed unmodified > from Ajuntament de Barcelona's Open Data BCN and Portaldades portals and > from the National Statistics Institute (INE) for income. The > site adds navigation, comparison and charts; it does not adjust, model or > forecast the numbers. ## How to use this site as a data source Prefer the JSON API over parsing pages. It is public, needs no key or account, sets no cookie, and returns the same response to anonymous and signed-in callers. Territory names are Catalan proper nouns in every locale and are the join key across every endpoint. - Catalogue — every domain, metric, geo level and published year range. Start here; it is what makes any other query constructible: https://openurbe.com/api/cities/barcelona/explore/catalogue?locale=ca - Snapshot — every territory's value for one metric in one year. Set `view=snapshot` with `domain`, `metric`, `geo` (`neighbourhood` or `district`) and `year`. - Trend — one or more territories over a span. Set `view=trend` with `from_year`, `to_year` and a repeated `territories` parameter. Every ranking page also carries schema.org `Dataset` JSON-LD whose `distribution` field is the endpoint returning that page's figures. ## For agents: MCP and the operations API There is an MCP server, and it is the shortest path to these figures for anything that can speak the protocol. Streamable HTTP, stateless, read-only, no key: `https://openurbe.com/mcp`. Six tools: `list_measures` (call it first), `get_snapshot`, `get_trend`, `get_composition`, `match_neighbourhoods` (rank neighbourhoods against several weighted criteria) and `neighbourhood_profile` (one to three territories across every layer). Every tool takes an optional `city`; left out, Barcelona answers. Setup for each client: https://openurbe.com/agents The same five operations are plain HTTP for clients that do not speak MCP, with the same request bodies and the same responses, described by OpenAPI at `https://barri-viu.fly.dev/openapi.json`: - `GET https://barri-viu.fly.dev/api/v1/cities/barcelona/ops/catalogue` - `POST https://barri-viu.fly.dev/api/v1/cities/barcelona/ops/{snapshot|trend|composition|match|dossier}` The city is part of the path: `barcelona` is Barcelona. Every response has one shape (`result_version` 1): `rows` are flat records described once by `fields`; `measures` gives each layer's label and unit (such as `EUR/month`), and rows mixing layers carry their own `unit`. Every territory row carries the publisher's `code`. `stats` holds the computed comparisons (median, rank, percentile, change): quote them. `sources` gives source, dataset, licence, period and caveats; a figure published only by district and applied to its neighbourhoods is marked `broadcast`. `charts` are Vega-Lite v5 specs that read the rows under the name `rows`; a map draws the GeoJSON at `geometry.url`, joined on `code`. `catalogue_hash` changes when the catalogue does. A refusal carries `error.code`, `error.message` and, when something is close, `error.did_you_mean`. ## Metrics - **rent** (`domain=housing`, `metric=rent`) — per neighbourhood, 2014–2025, unit `eur_month`, published by portaldades. Ranking page: https://openurbe.com/ca/barcelona/barris/lloguer. Latest as JSON: https://openurbe.com/api/cities/barcelona/explore/layer?domain=housing&metric=rent&view=snapshot&geo=neighbourhood&year=2025&locale=ca - **sale** (`domain=housing`, `metric=sale`) — per neighbourhood, 2014–2026, unit `eur`, published by portaldades. Ranking page: https://openurbe.com/ca/barcelona/barris/compra. Latest as JSON: https://openurbe.com/api/cities/barcelona/explore/layer?domain=housing&metric=sale&view=snapshot&geo=neighbourhood&year=2026&locale=ca - **income** (`domain=income`, `metric=per_person`) — per neighbourhood, 2015–2024, unit `eur`, published by ine. Ranking page: https://openurbe.com/ca/barcelona/barris/renda. Latest as JSON: https://openurbe.com/api/cities/barcelona/explore/layer?domain=income&metric=per_person&view=snapshot&geo=neighbourhood&year=2024&locale=ca - **population** (`domain=demographics`, `metric=population`) — per neighbourhood, 2013–2026, unit `count`, published by opendata-bcn. Ranking page: https://openurbe.com/ca/barcelona/barris/poblacio. Latest as JSON: https://openurbe.com/api/cities/barcelona/explore/layer?domain=demographics&metric=population&view=snapshot&geo=neighbourhood&year=2026&locale=ca - **tourist** (`domain=tourist_housing`, `metric=licences`) — per neighbourhood, 2018–2025, unit `count`, published by portaldades. Ranking page: https://openurbe.com/ca/barcelona/barris/pisos-turistics. Latest as JSON: https://openurbe.com/api/cities/barcelona/explore/layer?domain=tourist_housing&metric=licences&view=snapshot&geo=neighbourhood&year=2025&locale=ca - **crime** (`domain=crime`, `metric=offences`) — per district, 2011–2025, unit `count`, published by portaldades. Ranking page: https://openurbe.com/ca/barcelona/districtes/delictes. Latest as JSON: https://openurbe.com/api/cities/barcelona/explore/layer?domain=crime&metric=offences&view=snapshot&geo=district&year=2025&locale=ca ## Pages - Index of the cities: https://openurbe.com/ca - Barcelona, its rankings: https://openurbe.com/ca/barcelona - One ranking per layer of a city, every territory ordered by the figure: `/{locale}/{city}/{levels}/{layer}` - Sources, coverage and known gaps: https://openurbe.com/ca/metodologia - Sitemap of every page in every locale: https://openurbe.com/sitemap.xml Locales are `ca` (Catalan, primary), `es` and `en`. The three are translations of one another and share slugs, so a URL is convertible between them by swapping the prefix. There is no page per neighbourhood: a territory's figures are in the API above. ## Attribution and limits - Source: Ajuntament de Barcelona — Open Data BCN and Portaldades. - Licence: CC BY 4.0. Cite Ajuntament de Barcelona as the publisher of the figures and OpenUrbe as the source of the presentation. - Coverage varies by year and metric: a territory absent from a response has no published figure for that year, which is not the same as zero. Do not substitute one for the other. - Prices are per-territory averages. They are not summable into a city figure, and a mean of them is not Barcelona's average. Use the median territory when a single representative number is needed.