How Àgora builds the record of the XV legislature from open data
Àgora compares what the parties promised in 2023 with what the XV legislature actually did. For that it needs a record of the legislature that does not depend on anyone’s summary: which initiatives were tabled, which norms were passed, what the Government approved, and how each group voted. We build it from three public sources and keep every row traceable to its origin.
This post lists those sources, with the counts as they stand in the repository today, then explains how a bill is matched to a law and what the record leaves out. It says nothing about who did better: the record is the same for everyone, and the pledge scales are a separate step.
Three sources, scraping only where there is no API
| Source | What we take | Rows |
|---|---|---|
| Congress open data | Legislative initiatives and plenary votes | 488 initiatives, 2,179 votes |
| BOE | Laws, decree-laws, royal decrees, orders and section III provisions | 103 norms, 1,604 decrees and orders, 11,958 provisions |
| La Moncloa | The references of the Council of Ministers | 7,810 items from 159 meetings |
The Congress and the BOE publish data meant to be reused. La Moncloa does not: its only feed carries the latest meetings, so scripts/data/legislature/moncloa-referencias.mjs reads each meeting’s HTML page instead. It is the most fragile of the three sources.
Every script is idempotent and has a --check mode that validates the output without network access. Downloads are cached outside git, so the same cache gives the same file. The pledges themselves are read from the party programmes in a separate step, which we check quote by quote.
Initiatives: 488, and most of them lapsed
congreso/initiatives.json holds the bills of the legislature, which ran from 17 August 2023 to 6 October 2026. The Congress publishes them in separate files, and we merge them by type:
| Type | Count | Approved | Lapsed |
|---|---|---|---|
Government bills (projecte-llei) | 115 | 22 | 89 |
Private members’ bills (proposicio-llei) | 371 | 12 | 215 |
| Statute reform proposals | 2 | 0 | 0 |
The rest of the private members’ bills ended as rejected (56), withdrawn (50), fallen (28), not admitted (4), merged into another (3) or moved to another procedure (3). The two statute proposals were moved. The counts come from congreso/initiatives-meta.json, built from the Congress snapshot of 26 October 2026.
“Lapsed” means the bill was still pending when the legislature was dissolved. Àgora does not treat that as a rejection, and the earlier post on the two scales explains how a dissolution is handled.
Norms: 103, and how they are tied to bills
laws.json holds the norms of the legislature, each with its BOE id and its ELI, the European legislation identifier that gives a norm a stable URL:
| Rank | Count |
|---|---|
| Laws | 21 |
| Organic laws | 13 |
| Royal decree-laws | 67 |
| Constitutional reforms | 2 |
The Congress file of approved initiatives is the starting point, but it mixes three things: the norms, the corrections of errors to those norms, and the resolutions that record whether a decree-law was validated or repealed. scripts/data/legislature/boe.mjs separates them. The BOE gives the id, the ELI and the dates. Its consolidated database covers only part of the norms, so the id is looked up in the daily summary of the publication day and the ELI in the document’s XML.
Two matches follow from that:
- Laws to bills. All 34 laws and organic laws are tied to the initiative they came from (
llesCasadesAmbIniciativainlaws-meta.json). - Decree-laws to votes. A decree-law is in force on publication, and the Congress then votes to validate or repeal it. Of the 67, 46 were validated and 14 repealed, and 7 have no result yet in the data. 43 of them were also processed as a bill, so they carry a second expedient number.
The two constitutional reforms are not in the Congress approved file, because they are not laws. We declare them by hand in CONSTITUTIONAL_REFORMS in boe.mjs: Article 49 (BOE-A-2024-3099) and Article 69.3 (BOE-A-2026-10881). The README records that the list was checked by searching the BOE summaries of the whole legislature, and --check verifies that each final vote exists in the votes file.
Government acts that never pass through Parliament
A law needs a vote. Most of what a government does does not. So the record has three more layers, each from a different place:
- Royal decrees and orders, 1,604. 975 royal decrees and 629 ministerial orders published in section I of the BOE between 17 August 2023 and 2 November 2026 (
boe/decrees.json). Some daily summaries hang the department heading from a text node, which hid royal decrees 829/2023 and 830/2023, the ones that restructured the Government. The parser now walks those too, and 106 decrees and orders were recovered. - Section III provisions, 11,958. The BOE’s “Other provisions”: resolutions, agreements, conventions and grants (
boe/other.json). 8,491 of them are conventions. The BOE published 32,766 entries of this kind; 20,808 were discarded as administrative noise, and the file keeps the rest in a reduced form of five fields per row. - Council of Ministers items, 7,810. One row per item in the summary of each meeting’s reference, from 22 August 2023 to 27 October 2026 (
moncloa/agreements.json). 6,401 are agreements, 1,101 royal decrees, 129 draft bills, 101 reports and 62 decree-laws. For 3,952 of them we also keep up to 1,500 characters of the expanded text, because the title alone often does not say what was approved.
A decree approved by the Council of Ministers and published in the BOE appears in both feeds. They are different facts about different days, and Àgora keeps them apart. A rule stops the layers from overreaching: an act in section III can never prove a pledge about a law or about taxes, and a draft bill is at most a partial result.
Votes: 2,179 in 148 sessions
congreso/votes.json has every plenary vote the Congress publishes in JSON, from 19 September 2023 to 30 September 2026, with the totals and the tally for each group. Each vote gets a result, “approved” or “rejected”, taken from the Congress’s own assent field when it exists and otherwise from yes against no. 23 votes carry a needsCheck flag: the yes votes beat the no votes but fell short of the 176 of an absolute majority, and the text mentions an organic law, a statute, an investiture or an absolute majority, so we cannot tell whether one was required.
Public roll-call votes are the exception. For those the Congress publishes only a PNG of the totals, so the vote of each deputy is not in the open data. Ten votes remain in missing.json because the source gives no usable JSON. For the three investitures and the final vote on the Article 49 reform, we recovered the names from the Diario de Sesiones, the official transcript, with a script that checks that the names add up to the official count. The transcript does not say each deputy’s group, so we take it from their closest vote, and it does not list absentees.
Vote affinity: a count, not a judgement
The affinity page crosses the groups two by two. src/features/legislature/stats.ts defines a group’s stance in a vote as the option, yes, no or abstention, chosen by most of its deputies. A tie at the top, or no vote cast, means no stance. For each pair, affinityCounts counts the votes in which both have a stance and, of those, the ones where it is the same. The percentage is one divided by the other.
Two details matter when reading it. The Mixed Group is split into Podemos, BNG, CC and UPN, because it votes by deputy. And an abstention is a stance of its own, so a group that abstains does not agree with one that votes yes. Affinity measures how often two groups voted alike. It says nothing about why, and a high number may be only a long run of unanimous votes.
What the record leaves out
- Only what the sources publish. Amendments, committee votes and written questions are not here. The Senate has its own record, with its own gaps.
- La Moncloa is read from HTML. If the page layout changes, a meeting can be read incompletely until the parser is fixed. The
--checkmode catches malformed rows, not a missing one. - A decree in the BOE is not a policy that worked. The record says an act was published on a date. It does not say what it achieved.
- The sources end on different days: 27 October for Moncloa, 2 November for the decrees, 30 September for the votes. A norm published after those days is not in the record yet.
- Some votes are reconstructed or absent. The ten in
missing.jsonhave no data, and the four recovered from the transcript have no absentees and an inferred group for each name.
Laws, decrees and provisions carry the URL of their BOE page, and initiatives carry the Congress one, so any row can be checked at its source. The legislature page has the laws, the votes and the affinity matrix built on this record.