Skip to content

Scrape house bills from congress.gov.ph instead of the Senate website #1

@kgreyy

Description

@kgreyy

House bills can be sourced from the House Legislative Documents page.

The page itself requests data from this endpoint:

[POST] https://api.v2.congress.hrep.online/hrep/api-v1/bills/list

After passing the Cloudflare check, you can send a payload with the sample parameters:

{
  "page": 0,
  "limit": 10,
  "congress": 103,
  "filter": ""
}

Query Parameters

  1. Pagination / Limits
    The limit parameter is not bounded, so you can request all bills in a single payload. For example, to fetch all bills from the 20th Congress:
{"page": 0, "limit": 10000, "congress": 103, "filter": ""}
  1. The congress field corresponds to the following mapping:
CONGRESS_MAP = {
    0: "All Congresses",
    103: "20th Congress", # lol @ indexing
    19: "19th Congress",
    18: "18th Congress",
    17: "17th Congress",
    16: "16th Congress",
    15: "15th Congress",
    14: "14th Congress",
    13: "13th Congress",
    12: "12th Congress",
    11: "11th Congress",
    10: "10th Congress",
    9: "9th Congress",
    8: "8th Congress",
}

Why?

This API provides a much better structured schema for bill data, including:

  • Bill Information
    Bill Information
  • Authors and Co-Authors (most reliable source for attribution)
    Authors and Co-Authors
  • Bill Status
    Bill Status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions