DEV Community

AIskaron
AIskaron

Posted on AI-assisted

Spain's official gazettes (BOE, BOJA, DOG, DOGC) as JSON: a free Apify Actor for daily alerts

If you build compliance dashboards, legal alerts or news tooling for Spain, sooner or later you need the new laws, decrees and orders as data. The Official State Gazette (BOE, Boletín Oficial del Estado) publishes open data, but turning a daily summary into a clean, filtered, deduplicated feed is plumbing you would rather not write twice.

NormaWatch is a free, MIT-licensed Apify Actor that does this plumbing. It reads the BOE daily summary and returns the new general provisions (Section I) as JSON, with official links. Think of it as a small "BOE API" you can schedule. Optionally it can also read three regional gazettes: BOJA (Andalusia), DOG (Galicia) and, since version 1.8, DOGC (Catalonia).

Update: this post first described version 1.5. See "What's new in 1.6 to 1.8" below for what has changed since.

What you get

Each item is metadata plus links, never the full text:

{
  "id": "BOE-A-2026-21530",
  "date": "2026-10-16",
  "bulletin": "BOE",
  "section": "1",
  "department": "MINISTERIO DE HACIENDA",
  "epigraph": "Procedimientos administrativos",
  "title": "Orden HAC/1000/2026, de 15 de octubre, por la que se aprueba un modelo de ejemplo.",
  "urlHtml": "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2026-21530",
  "urlPdf": "https://www.boe.es/boe/dias/2026/10/16/pdfs/BOE-A-2026-21530.pdf",
  "urlXml": "https://www.boe.es/diario_boe/xml.php?id=BOE-A-2026-21530",
  "retrievedAt": "2026-10-16T09:30:00.000Z",
  "normType": "Orden",
  "source": "Fuente de los datos: Agencia Estatal Boletín Oficial del Estado",
  "sourceUrl": "https://www.boe.es"
}
Enter fullscreen mode Exit fullscreen mode

(This sample is invented, to show the shape; the fields are the real ones. DOGC items add sourceUpdated, and some fields appear only with certain options.) In the Apify console the same data appears as a table, and you can export JSON or CSV or read it through the Apify API.

What's new in 1.6 to 1.8

1.6: laws that change other laws. An optional relations setting (off by default) reads the official legal analysis of each BOE provision. Each item then carries changes: which norms it repeals, modifies, replaces, adds to, develops, transposes or corrects, with a link to the affected norm and a short note on what is affected. Weak links such as "cites" or "in accordance with" are left out. It applies to the BOE only (not the regional gazettes) and costs one extra request per provision (capped at 1000 documents per run), and a failure on one document does not fail the run.

There is also followIds: give it up to 100 BOE identifiers (BOE-A-YYYY-N) for laws you care about, and any new provision that changes one of them is flagged in followed. Those provisions are delivered even if your department, keyword or norm-type filters would have dropped them. In the e-mail, Telegram and Slack notices they appear first, under "Cambia una ley que sigues" (the notice text is in Spanish).

1.7: public-sector job calls. The optional Section II-B of the BOE ("Oposiciones y concursos") can be switched on with "sections": ["2B"]. By default you get only the calls (convocatorias); includeProcessUpdates also adds follow-up notices such as lists of admitted and excluded candidates, tribunals and corrections. Each item gets a stage field (convocatoria, actualizacion or otro), derived from the title, so treat it as a hint, not an official field. Only metadata and links are kept, Section II-A (appointments) is never read, and a stricter filter drops titles that name people. The changelog counts roughly 35 provisions a day in total, mostly from local administrations and universities.

1.8: Catalonia. "DOGC" joins the bulletins option next to "BOE", "BOJA" and "DOG". It covers laws, decree-laws, decrees, legislative decrees and orders of the Diari Oficial de la Generalitat de Catalunya, read from the Generalitat's open dataset. Items appear the day they are published, and unlike the DOG you can ask for past dates. Two limits to know about: it does not include resolutions or announcements, and the dataset does not publish the issuing department, so the departments filter finds nothing in the DOGC (keywords and normTypes work). The data is under the Generalitat's open information licence (Llicència oberta d'ús d'informació - Catalunya); every item carries the attribution, and DOGC items add a sourceUpdated date. The Generalitat de Catalunya is not involved in NormaWatch and does not endorse it.

If you do not turn these options on, your runs behave as before: with the same input, the output, the requests and the onlyNew memory match the earlier version (1.7 also made the shared filter for personal titles slightly stricter).

Useful options

  • Date range: up to 367 dates in one run, so you can backfill a year. Leave it empty for today.
  • Filters: department, title keywords, and norm type. The norm type is derived by the Actor from the title (in the DOGC, from the rank of the norm), so treat it as a hint, not an official field.
  • onlyNew: remembers what it already delivered, per filter combination, so a daily scheduled run returns only new items.
  • Notices: an optional summary by e-mail, Telegram or Slack.
  • Regional gazettes (optional): BOJA (Andalusia, CC BY 4.0), DOG (Galicia, CC BY-SA 4.0) and, since 1.8, DOGC (Catalonia, Generalitat open information licence). The DOG feed only holds the latest issue, so it works for daily runs, not for history; the BOJA and DOGC are queried one date at a time, so you can pass past dates. The Junta de Andalucía, the Xunta de Galicia and the Generalitat de Catalunya are not involved and do not endorse it.
  • Relations and followed laws (optional, since 1.6): relations and followIds, described above.
  • Job calls (optional, since 1.7): Section II-B with sections: ["2B"].
  • Section III (optional, off by default): a restricted, filtered subset. Because that section contains titles that name people, a text filter reduces the risk but cannot remove it. Review the output before sharing it.

A typical setup

  1. Open the Actor on the Apify Store.
  2. Run it once with a date range for your initial backfill.
  3. Create a daily schedule with onlyNew: true and your filters, for example:
{
  "departments": ["hacienda"],
  "keywords": ["modelo", "orden"],
  "onlyNew": true,
  "maxItems": 200
}
Enter fullscreen mode Exit fullscreen mode
  1. Point a webhook, a spreadsheet or your own dashboard at the dataset, or turn on the built-in notice.

To add the regional gazettes, set "bulletins": ["BOE", "BOJA", "DOG", "DOGC"].

Polite by design

It requests one day at a time with a pause between requests, retries with backoff, stops after repeated failures and identifies itself with a User-Agent. A year-long run (367 requests) took 7 minutes 19 seconds in a local test, with no failures; on Apify it may vary.

Honest limits

  • It is not an official BOE or AEBOE service, and the output is not an official text. For legal effect, use the text published by the Agency.
  • Metadata and links only. No full text.
  • The stage field and the norm type are derived from titles, so they are hints.
  • The DOG only serves its latest issue; the DOGC has no resolutions and no department.
  • The BOE has its own free alert service, "Mi BOE". NormaWatch adds exact filters, memory of what was already delivered, and structured data.
  • It is free to use; you only pay for your own Apify platform usage (see Apify's pricing page).
  • The documentation is in Spanish, with a short English summary at the top of the README.

Links

Issues and ideas are welcome on GitHub. By AIskaron.

Top comments (0)