Personal use · 2026

Plan Vive tracker

Daily snapshots of Madrid's public housing waiting list.

The public list loads its data from a paginated API hidden in the site's JavaScript. The scraper pulls more than 200,000 records every day while respecting the server's limits, and a self-contained HTML report shows how the list evolves.

Stack
PythonREST APIsPandasHTML reports

The question

Plan Vive is a public rental housing programme of the Community of Madrid. The applicants list is public, but the website only shows it page by page, so it's impossible to answer simple questions: how many applications are there per municipality, how fast is the list moving, how many have been rejected this week?

This project downloads the full list every day, keeps a dated snapshot and builds a report that shows how the list changes over time.

Finding the real data source

The HTML doesn't contain the data: the table is filled in the browser from a paginated JSON API, which I found by reading the site's JavaScript bundle. Calling that API directly is far lighter for the server than rendering pages, and every record already comes with its municipality, lot, priority and status.

The API returns a fixed 20 records per page and ignores page-size parameters, so a full download of both lots (about 97,000 and 129,000 records) means around 11,300 requests.

Two rate limits, measured

Instead of guessing, I measured how the server behaves. There are two limits per IP: the application answers with a JSON “throttled” message, and the cloud edge in front of it answers with an HTML 429 page and bans the IP for about three minutes. A single IP holds about one request per second; starting faster seems fine for a few hundred requests and then collapses, which is typical of a sliding window.

The scraper paces itself per IP, backs off when either limit fires and can resume where it stopped. With one IP a full run takes a few hours, which is fine for a daily job. The result is a dated CSV per day and a single offline HTML report with trends, aggregates and filterable raw data.

$ highlights

  • Measured both rate limits (application and edge) and tuned the crawl to stay under them.
  • Time series built from daily snapshots; one offline HTML file with trends and filterable raw data.

Want to talk about this project or something similar?

Get in touch