congress-api-docs icon indicating copy to clipboard operation
congress-api-docs copied to clipboard

Offering a paginated list of recent votes, in addition to client-chosen date ranges

Open konklone opened this issue 8 years ago • 9 comments

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?

konklone avatar Aug 19 '17 17:08 konklone

I think so, yes. Sort of like the recent bills, just for votes?

dwillis avatar Aug 19 '17 17:08 dwillis

Yes, exactly.

konklone avatar Aug 19 '17 17:08 konklone

This has been added: https://projects.propublica.org/api-docs/congress-api/votes/

dwillis avatar Aug 29 '17 21:08 dwillis

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 avatar Apr 04 '19 17:04 astrowonk

@astrowonk it looks like they are there now, fwiw.

dwillis avatar Apr 04 '19 18:04 dwillis

@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 avatar Apr 05 '19 00:04 astrowonk

@astrowonk It seems like you're referring to a client library rather than the API, is that right? Can you tell me which one?

dwillis avatar Apr 05 '19 20:04 dwillis

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 avatar Apr 05 '19 23:04 astrowonk

@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.

dwillis avatar Apr 06 '19 00:04 dwillis