BillTracer is a tool I built for the Congressional Hackathon to make it easier to analyze how congressional bills change as they move through the legislative process.
It fetches two different versions of a bill from GovInfo and produces a side-by-side, section-aware comparison in HTML. The viewer highlights what text was added, removed or modified and applies simple heuristics to flag provisions related to funding.
Youtube Prototype Demo: https://youtu.be/PBa_G2kVW18?si=rLCRcPSMGERZGYrd
Playable Link: https://billtracer.onrender.com
Legislation often undergoes major edits as it moves from introduction to enrollment. Tracking those changes by hand is tedious and confusing, especially for congressional staff, students, advocates or anyone who isn’t a legal expert.
I made BillTracer because I wanted a clearer way to see how bills evolve. My goal was to build something that encourages civic engagement, makes government processes less intimidating, and supports transparency.
- APIs and data - I used GovInfo’s API to pull down different versions of a bill.
- Parsing - I wrote a Python parser to split bills into sections (
SEC., DIVISION, TITLE, SUBTITLE, etc.). - Diffing engine - I built logic to compare the two versions at the word level, marking insertions and deletions.
- Heuristics - I added keyword checks to flag funding, authority, and reporting language.
- HTML viewer - Finally, I created a HTML that makes the changes searchable, filterable and easier to read.
- Congressional bills are not standardized. Some had clean section headers, others didn’t, which made parsing hard.
- Highlighting every change at once looked really challenging, so I worked on sectioning and filters to make the output readable.
- Government data is messy: APIs and documents don’t always follow a neat structure, but careful parsing can still make them usable.
- Tech + civics go hand in hand because even small projects can make the legislative process more transparent and accessible for everyone.
- Text retrieval from govinfo.gov
- Comparisons between any two versions of a bill (e.g., Introduced -> Enrolled)ed)
- Section recognition with fallbacks for headers
- Interactive report with filters, search, and toggle for unchanged sections
- Funding summary that highlights appropriation-related changes
- Lightweight: only requires Python and
requests
- Edit the bill information on the fetch script and add your bill information.
CONGRESS = 116
CHAMBER = "house" # "house" or "senate"
BILL_NUM = 748
VER_A = "ih" # ih, rh, eh, enr.
VER_B = "enr"
- Python 3.9 or newer
requestslibrary
Install with:
pip install requests