LibraryOfCongress / api.congress.gov

congress.gov API
601 stars 38 forks source link

feat(bill): sort by `updateDateIncludingText` #230

Open ryparker opened 2 months ago

ryparker commented 2 months ago

The bill list API currently returns items that are not in any particular order (that I recognize). There is an ability to sort by updateDate, however it would be nice to have the ability to sort by updateDateIncludingText since there is no other way to list legislation text updates. This is useful for caching purposes related to legislation text.

Perhaps it makes sense to default sort by updateDateIncludingText and continue to offer the sort by updateDate option. And/or support updateDateIncludingText+desc/ updateDateIncludingText+asc sort param options.

e.g.

curl --location 'https://api.congress.gov/v3/bill/118/hr?format=json&api_key=<API_KEY>'

Response:

{
    "bills": [
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-20",
                "text": "Presented to President."
            },
            "number": "7888",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "Reforming Intelligence and Securing America Act",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:24Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/7888?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-20",
                "text": "Motion to proceed to consideration of measure made in Senate by Unanimous Consent."
            },
            "number": "3935",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "Securing Growth and Robust Leadership in American Aviation Act",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T06:11:33Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/3935?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Message on Senate action sent to the House."
            },
            "number": "4389",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "Migratory Birds of the Americas Conservation Enhancements Act of 2023",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T06:11:33Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/4389?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "actionTime": "12:05:02",
                "text": "At the conclusion of debate, the Yeas and Nays were demanded and ordered. Pursuant to the provisions of clause 8, rule XX, the Chair announced that further proceedings on the motion would be postponed."
            },
            "number": "3602",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "Transnational Criminal Organization Illicit Spotter Prevention and Elimination Act",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:21Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/3602?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "actionTime": "11:06:24",
                "text": "Rule H. Res. 1160 passed House."
            },
            "number": "8038",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "21st Century Peace through Strength Act",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:24Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8038?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on the Judiciary."
            },
            "number": "8098",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend title 28, United States Code, to provide an Inspector General for the judicial branch, and for other purposes.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:18Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8098?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the Committee on Energy and Commerce, and in addition to the Committees on Transportation and Infrastructure, Agriculture, and Foreign Affairs, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned."
            },
            "number": "8092",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To require the Administrator of the Environmental Protection Agency to carry out certain activities to protect communities from the harmful effects of plastics, and for other purposes.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:19Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8092?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on the Judiciary."
            },
            "number": "8097",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To reauthorize the Radiation Exposure Compensation Act.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:23Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8097?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on the Judiciary."
            },
            "number": "8081",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To terminate United States Secret Service protection for felons.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:19Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8081?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Energy and Commerce."
            },
            "number": "8089",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend title XIX of the Social Security Act to require certain additional provider screening under the Medicaid program.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:22Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8089?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Homeland Security."
            },
            "number": "8090",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend the Homeland Security Act of 2002 to establish a council within the Department of Homeland Security to coordinate departmental efforts to identify, address, and mitigate cross-functional impacts of global climate change with respect to the Department's programs and operations, and for other purposes.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:23Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8090?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Energy and Commerce."
            },
            "number": "8082",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To provide that certain actions by the Federal Communications Commission shall have no force or effect.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:15Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8082?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Energy and Commerce."
            },
            "number": "8084",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend title XIX of the Social Security Act to require States to verify certain eligibility criteria for individuals enrolled for medical assistance quarterly, and for other purposes.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:16Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8084?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Energy and Commerce."
            },
            "number": "8094",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend title XIX of the Social Security Act to modify certain asset recovery rules.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:20Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8094?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the Committee on Science, Space, and Technology, and in addition to the Committee on Energy and Commerce, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned."
            },
            "number": "8086",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend the Federal Fire Prevention and Control Act of 1974 to update the fire prevention and control guidelines to require the mandatory installation of carbon monoxide alarms in all places of public accommodation, and for other purposes.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:24Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8086?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the Committee on Oversight and Accountability, and in addition to the Committees on Transportation and Infrastructure, and Natural Resources, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned."
            },
            "number": "8100",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To provide for the issuance of a Great Lakes Restoration Semipostal Stamp.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:20Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8100?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on the Judiciary."
            },
            "number": "8093",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend the State Justice Institute Act of 1984 to authorize the State Justice Institute to provide awards to certain organizations to establish a State judicial threat intelligence and resource center.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:19Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8093?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Energy and Commerce."
            },
            "number": "8085",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To require the Federal Energy Regulatory Commission to promulgate regulations that accelerate the interconnection of electric generation and storage resources to the transmission system through more efficient and effective interconnection procedures.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:14Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8085?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Ways and Means."
            },
            "number": "8095",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To amend the Internal Revenue Code of 1986 to extend the energy credit with respect to electrochromic glass.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:26Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8095?format=json"
        },
        {
            "congress": 118,
            "latestAction": {
                "actionDate": "2024-04-19",
                "text": "Referred to the House Committee on Energy and Commerce."
            },
            "number": "8091",
            "originChamber": "House",
            "originChamberCode": "H",
            "title": "To prohibit Federal funding of National Public Radio and the use of Federal funds to acquire radio content.",
            "type": "HR",
            "updateDate": "2024-04-20",
            "updateDateIncludingText": "2024-04-20T19:35:16Z",
            "url": "https://api.congress.gov/v3/bill/118/hr/8091?format=json"
        }
    ],
    "pagination": {
        "count": 8091,
        "next": "https://api.congress.gov/v3/bill/118/hr?offset=20&limit=20&format=json"
    },
    "request": {
        "billType": "hr",
        "congress": "118",
        "contentType": "application/json",
        "format": "json"
    }
}