Offering a paginated list of recent votes, in addition to client-chosen date ranges
The "Get Votes By Date" endpoint requires clients to pick a specific month or date range. For clients where fixed-length pagination helps make it easier to do processing and notifications, it would be helpful to support a feed of the most recent votes, ordered by vote date and with normal pagination by date.
Would this be easy for the API to add support for?
I think so, yes. Sort of like the recent bills, just for votes?
Yes, exactly.
This has been added: https://projects.propublica.org/api-docs/congress-api/votes/
The "Recent Votes" endpoint ... doesn't have recent votes. At least, today, it was missing all votes from the House when the today() method returned them properly.
@astrowonk it looks like they are there now, fwiw.
@dwillis Yep! Does anyone know how the API works under the hood? How does .recent() pull in records vs .today() or the date range searches? They don't seem to be pulling from exactly the same sources.
@astrowonk It seems like you're referring to a client library rather than the API, is that right? Can you tell me which one?
Sorry, I am referring to both in some sense, and not delineating well between the two. I am using my fork for a python library: propublica-congress.
I wrote a recent method which just pulls from /{chamber}/votes/recent.json where chamber in my case on Thursday was the house. But it just didn't have the latest votes, while the library's .today() method which pulls from {chamber}/votes/{start-date}/{end-date}.jsondid.
I ended up writing my own "last 3 days" type setup that I'll use. But I'm curious how on the API end the "Recent" end point works, compared to the date range end point.
@astrowonk I think the difference you saw is a matter of caching on the part of the API responses. They don't pull from different sources, so they should reflect the same data.