Inspiration

After failing to find adequate information on a recent bill tabled in parliament, we wanted to create a website that would link academic studies and parliamentary bills to better understand their context, purpose and efficacy. Political news coverage often focuses on party drama rather than substance — we wanted a tool that lets any Canadian look up a bill and immediately see what peer-reviewed research says about the topic.

What it does

Know Your Bill connects every active Canadian parliamentary bill with relevant academic research papers. Users can browse all 144+ bills currently before Parliament, filter by party, legislative stage, or date tabled, and see exactly where each bill sits in the 7-step legislative process from First Reading to Royal Assent. When you click into a bill, you get a plain-language summary of what it proposes, a curated set of academic papers from OpenAlex matched to the bill's topic, and a research synthesis that analyzes what the evidence says about the bill's potential impact. The home page also pulls live Canadian politics headlines from CBC to keep users connected to current events.

How we built it

  • Backend: Python FastAPI with SQLAlchemy ORM and SQLite. We pull bill data from Parliament of Canada's LEGISinfo API, match sponsors to parties using the OurCommons Members XML API, and fetch legislative summaries from individual bill detail endpoints.
  • Frontend: React with Vite and React Router. The UI features a bill process explainer sidebar, progress bars on every bill card, and a detailed 7-stage legislative tracker on bill pages.
  • Research pipeline: OpenAlex API fetches up to 10 academic papers per bill based on intelligent query extraction from bill titles. The Anthropic Claude API generates both bill summaries and research syntheses that analyze evidence strength, potential impact, and key takeaways.
  • News feed: CBC Politics RSS feed displayed as a headline carousel on the home page.

Challenges we ran into

  • Parliament's API field names weren't documented — we had to inspect raw JSON responses to discover the correct fields like BillNumberFormatted and SponsorEn.
  • Matching bill sponsors to political parties required cross-referencing a completely separate API (OurCommons Members XML) and building a name-matching system that handles titles like "Hon." and "Right Hon."
  • Most bills lack official legislative summaries from Parliament's Library. We solved this by generating plain-language summaries on-demand using Claude when a user views a bill.
  • Python 3.8 compatibility issues — modern type hint syntax like list[str] and Pydantic v2 patterns kept breaking, requiring from future import annotations and v1 fallbacks throughout.

Accomplishments that we're proud of

  • The full pipeline works end-to-end: 144 bills crawled, 1,800+ academic papers matched, and research summaries generated in real time.
  • The legislative progress tracker gives citizens an intuitive visual of where any bill stands in the lawmaking process — something even Parliament's own website doesn't make this clear.
  • Research syntheses are balanced and evidence-based, with sections on evidence strength and honest assessments of gaps — not just a summary, but a critical analysis.

What we learned

  • Government open data APIs are powerful but inconsistent — field names change, some endpoints return XML while others return JSON, and documentation is sparse.
  • Matching unstructured data across multiple government sources (bills, sponsors, parties) requires creative heuristics, not just exact lookups.
  • Generating useful summaries from academic paper metadata alone (titles, abstracts, citation counts) is surprisingly effective when guided by good prompts.

What's next for Know Your Bill

  • Provincial bill coverage — expand beyond federal Parliament to include Ontario, BC, Quebec and other provincial legislatures.
  • Bill alerts — let users subscribe to specific bills or topics and get notified when the legislative stage changes.
  • Voting record integration — show how each MP voted on bills that made it to a vote.
  • Full-text analysis — parse actual bill PDFs for deeper research matching instead of relying on titles alone.
  • Community discussion — let users annotate bills with their own research findings and perspectives.

Built With

Share this project:

Updates