« All posts

Spain's BORME Registry Has a Hidden Open-Data API

Spain's BORME registry has offered a free open-data API since 2009 that almost nobody uses—now parsed into 9.5 million structured company events.

Spain's official commercial-registry gazette, BORME, publishes every company event—incorporations, director changes, insolvencies. Most tools scrape it from PDFs, but boe.es has quietly offered a free, keyless, rate-limit-free open-data API since 2009 that almost nobody uses.

A team backfilled the entire archive—9.5 million company events from 2009 to today—into Postgres using this API. Along the way they hit six recurring traps: 404 responses that still return an XML body on non-publication days, HTTP 200 responses that actually contain an error message for missing documents, ambiguous trailing dots in company names, single paragraphs that chain multiple legal acts together, provincial quirks in formatting and accents, and five different date formats.

Their solution was a deterministic parser built over a closed vocabulary of roughly 50 act types and 80 officer roles—no LLM in the parsing path. The key quality metric was the ratio of consumed to total characters, which averaged 99.9% across the 17-year corpus. The full backfill took about 160,000 requests and two days of wall-clock time at one request per second.

The exercise shows engineers that official public APIs—even undocumented, underused ones—can be far more reliable than scraping PDFs. The team also packaged the parsed feed as a typed JSON dataset with a REST API, webhooks, and an MCP server for AI agents.