LibraryOfCongress / api.congress.gov

congress.gov API
667 stars 42 forks source link

(committee-report): sort by `updateDate` #224

Open ryparker opened 8 months ago

ryparker commented 8 months ago

The committee-report list API currently returns items that are not in any particular order (that I recognize). It would be ideal if there was a sort option, but at the least it would be helpful for caching purposes if all list APIs sorted by updateDate.

e.g.

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

Response:

{
    "pagination": {
        "count": 660,
        "next": "https://api.congress.gov/v3/committee-report/118?offset=20&limit=20&format=json"
    },
    "reports": [
        {
            "chamber": "House",
            "citation": "H. Rept. 118-432",
            "congress": 118,
            "number": 432,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-27 08:05:21+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/432?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-431",
            "congress": 118,
            "number": 431,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-27 08:05:36+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/431?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-430",
            "congress": 118,
            "number": 430,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-22 08:05:32+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/430?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-429",
            "congress": 118,
            "number": 429,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-22 08:05:39+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/429?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-428",
            "congress": 118,
            "number": 428,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-20 20:26:14+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/428?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-427",
            "congress": 118,
            "number": 427,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-20 08:05:24+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/427?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-426",
            "congress": 118,
            "number": 426,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 20:26:12+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/426?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-425",
            "congress": 118,
            "number": 425,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-19 19:56:13+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/425?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-424",
            "congress": 118,
            "number": 424,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-19 17:41:15+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/424?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-423",
            "congress": 118,
            "number": 423,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-19 15:26:13+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/423?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-422",
            "congress": 118,
            "number": 422,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-19 16:56:16+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/422?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-421",
            "congress": 118,
            "number": 421,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 12:56:12+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/421?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-420",
            "congress": 118,
            "number": 420,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 20:26:12+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/420?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-419",
            "congress": 118,
            "number": 419,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-12 21:26:15+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/419?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-418",
            "congress": 118,
            "number": 418,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 12:56:12+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/418?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-417",
            "congress": 118,
            "number": 417,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-12 23:26:17+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/417?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-416",
            "congress": 118,
            "number": 416,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 22:23:46+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/416?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-416",
            "congress": 118,
            "number": 416,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 12:56:12+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/416?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-415",
            "congress": 118,
            "number": 415,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-08 23:26:13+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/415?format=json"
        },
        {
            "chamber": "House",
            "citation": "H. Rept. 118-414",
            "congress": 118,
            "number": 414,
            "part": 1,
            "type": "HRPT",
            "updateDate": "2024-03-18 22:23:54+00:00",
            "url": "https://api.congress.gov/v3/committee-report/118/HRPT/414?format=json"
        }
    ],
    "request": {
        "congress": "118",
        "contentType": "application/json",
        "format": "json"
    }
}
wblackerby commented 1 week ago

Hi @ryparker, I'm hoping to get a little more information about what you'd like to see here -- recognizing it's been a while since you opened this issue! Do I understand correctly that, barring a sort option, you would like to see the committee-report endpoint (and really all list endpoints generally) sorted by descending updateDate?