Civic data platform

It's Half-Staff Because

Current half-staff status for every state and the federal flag, with links to the proclamations behind it.

Next.jsTypeScriptSupabasePlaywrightOpenAICapacitor

What it is

It's Half-Staff Because shows the current half-staff status for every state, DC, and the federal government. Each status links to its source. The site also includes history, statistics, alerts, an RSS feed, an embeddable widget, and a public API. It is available as a PWA and an Android app.

The problem

There is no single source for half-staff orders. Governors' offices and the White House publish them through 52 separate websites, using a mix of press releases, feeds, APIs, and ordinary web pages. Some sites block automated traffic, and there is often no notice when an order ends.

How it works

Every jurisdiction gets a scraper suited to what it publishes:

RSS / Atom feeds~18 jurisdictions
REST APIs (JSON)~8 jurisdictions
HTML scraping~13 jurisdictions
Playwright (full browser)~9 jurisdictions, for bot-protected sites

The scrapers run on Railway and pass new documents to an LLM that extracts the reason, dates, and issuer. The result is checked for duplicates and stored in Supabase. Orders expire automatically when their source stops reporting them. The Next.js site runs on Vercel.

Keeping it accurate

Accuracy is the difficult part. Government documents are inconsistent, and the language model can make mistakes. I added deduplication, automatic expiration, and a link to the original proclamation for every status. The scrapers also need regular maintenance as those 52 sites change.

Status

The site is live at itshalfstaffbecause.com. It includes notifications, a public API, and a widget that can be embedded on another site.