Seeking the best way to query actions of a body on a specific date?


#1

Hello Open States Community. This is my first post. Hopefully I’m not overlooking something I should include or some protocol.

I have been working with the API v2 for a few weeks now and have the need to determine that actions occurred on a specific day or range for a specific legislative body.

As far as I can tell I could use the bills api with actionsSince as earliest date in range of interest and retrieve the appropriate bills including actions. I end up with all bills since the early date in range through today or end of year. I then I have to iterate through each bill’s actions. This isn’t so bad so long as the date is late in the leg session of interest, but if I want to know what happened on Jan 3 of say 2018 its seems to me I would get all actions on all bills for the year. And my run times confirm this.

So I am using the following query:

https://openstates.org/graphql?&apikey=…&query=
{bills(first: " + 32 + " %s jurisdiction: %s classification: “bill” actionSince: “%s”)
{edges {node {identifier title actions {description date}}}
pageInfo {hasNextPage endCursor}}}

Is there some way of implementing the intersection of actionsSince and a hypothetical actionsBefore? Or add an actionsWithin? Or maybe there is an entirely different way to querying this set of data I have not considered.

I have communicated with the incredibly knowledgeable and helpful Ed Staub. He thought what I was doing was it, or that I might get my own download and index it as I saw fit. I am trying to avoid the latter. Ed thought there would be value in posting this message here in order to learn what others might think and to document inquiry.

Thank you for your insights.


#2

This topic was automatically closed 70 days after the last reply. New replies are no longer allowed.