LibraryOfCongress / api.congress.gov

congress.gov API
601 stars 38 forks source link

(senate-communication): sort by `updateDate` #218

Open ryparker opened 3 months ago

ryparker commented 3 months ago

The senate-communication 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/senate-communication/118?format=json&api_key=<API_KEY>'

Response:

{
    "pagination": {
        "count": 4104,
        "next": "https://api.congress.gov/v3/senate-communication/118?offset=20&limit=20&format=json"
    },
    "request": {
        "congress": "118",
        "contentType": "application/json",
        "format": "json"
    },
    "senateCommunications": [
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 507,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/507?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 495,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/495?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 496,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/496?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 508,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/508?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 3327,
            "updateDate": "2024-01-18T09:00:21Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/3327?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 3328,
            "updateDate": "2024-01-18T09:00:21Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/3328?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 3302,
            "updateDate": "2024-01-19T09:00:26Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/3302?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 509,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/509?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 510,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/510?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1127,
            "updateDate": "2023-05-03T08:15:16Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1127?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1615,
            "updateDate": "2023-07-13T08:15:22Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1615?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 497,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/497?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1733,
            "updateDate": "2023-07-21T08:15:16Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1733?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 3421,
            "updateDate": "2024-02-01T09:00:20Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/3421?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1607,
            "updateDate": "2023-07-13T00:00:21Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1607?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1608,
            "updateDate": "2023-07-13T00:00:21Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1608?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1614,
            "updateDate": "2023-07-13T08:15:22Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1614?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 2140,
            "updateDate": "2023-09-20T08:00:24Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/2140?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 498,
            "updateDate": "2023-02-28T09:15:15Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/498?format=json"
        },
        {
            "chamber": "Senate",
            "communicationType": {
                "code": "EC",
                "name": "Executive Communication"
            },
            "congress": 118,
            "number": 1203,
            "updateDate": "2023-05-10T08:30:25Z",
            "url": "https://api.congress.gov/v3/senate-communication/118/ec/1203?format=json"
        }
    ]
}

This is also true for all the filter endpoints: