LibraryOfCongress / api.congress.gov

congress.gov API
605 stars 38 forks source link

Bill `updateDate` filter is difficult to navigate #170

Open Gmanicus opened 8 months ago

Gmanicus commented 8 months ago

Hi there,

It's difficult to query bills when looking at a specific time frame.

As an example:

https://api.congress.gov/v3/bill?api_key={{API_KEY}}&limit=250
&fromDateTime=2019-11-14T00:00:00Z
&toDateTime=2019-11-14T23:00:00Z

This query spans 1 day in November of 2019 and returns 0 results.

https://api.congress.gov/v3/bill?api_key={{API_KEY}}&limit=250
&fromDateTime=2019-11-14T00:00:00Z
&toDateTime=2019-11-15T23:00:00Z

This query looks at just one more day later in November of 2019 and returns 10105 results, and most of these results are unexpectedly bills that are much older than 2019.

My guess is that this is related to the fact that the LOC reprocesses the bills when they are reissued by the GPO. So, is the updateDate telling us the last time the data for the bill actually changed, or is it just when it was last reprocessed?

If the latter is true, would it be possible to expose a changeDate with associated filter options that tells us when the data for the bill was last modified? I imagine that this would help spread out the results and be closer to the latestAction date.

mnewatloc commented 8 months ago

That's a good suggestion and we're exploring the feasibility. As always, thank you for your input.

Gmanicus commented 8 months ago

Thanks!