api.congress.gov icon indicating copy to clipboard operation
api.congress.gov copied to clipboard

Add offset and limit to the pagination object

Open adathouse opened this issue 1 month ago • 0 comments
trafficstars

When fetching multiple batches from a cursor it would be helpful to make the current position in the cursor explicit in the result.

e.g. curl "https://api.congress.gov/v3/bill?format=json&api_key=<<key>>" returns this pagination object:

    "pagination": {
        "count": 421313,
        "next": "https://api.congress.gov/v3/bill?offset=20&limit=20&format=json"
    }

It would be useful to have offset and limit directly in the pagination object so you don't need to parse the URL to get them.

The specific use case I'm working with is tracking the absolute sequence of cosponsors and I need to add the page offset to the list sequence in the result when iterating over multiple cosponsor pages. I'll open another issue to add the cosponsor index as a value in the cosponsor object, since that is useful for tracking the correct ordering for cosponsors.

adathouse avatar Oct 07 '25 14:10 adathouse