Open Civic Data API documentation: https://ocd-api-documentation.readthedocs.io/en/latest/
All API responses are in JSON
format.
Using the Open Civic Data API, you can do a query to find all bill votes for Chicago City Council that have both yes
and no
votes present for a particular legislative session:
Parameters:
- votes__option: vote results that you want to include in your filter results
- organization__id: unique id for the organization we are querying. In this case, this is the ID for Chicago City Council
- bill__legislative_session__identifier: Legislative session we want to filter on. We're looking at 2019.
Here's an example response:
{
"counts": [ ],
"bill": {
"id": "ocd-bill/31c0af70-0ce0-42b2-8f63-e7c24853dd00",
"identifier": "O2019-3901"
},
"id": "ocd-vote/515128d4-f5da-4523-9390-c5e0714c8679",
"motion_text": "Passed as Substitute",
"result": "pass",
"motion_classification": [ ],
"organization": {
"name": "Chicago City Council",
"id": "ocd-organization/ef168607-9135-4177-ad8e-c1f7a4806c3a"
},
"updated_at": "2019-07-08T13:53:55.963673+00:00",
"extras": { },
"created_at": "2019-06-13T03:01:59.594820+00:00",
"start_date": "2019-06-12"
},
You'll want to save the id for the vote result. In this case it is ocd-vote/515128d4-f5da-4523-9390-c5e0714c8679
.
To get the votes for a specific bill, use this endpoint, using the unique bill vote identifier:
https://ocd.datamade.us/ocd-vote/515128d4-f5da-4523-9390-c5e0714c8679
Parameters:
- bill ID: the unique GUID for the bill. In this case, it is
ocd-vote/515128d4-f5da-4523-9390-c5e0714c8679
It will return a JSON
object with each member and their vote. Below is an example. Their vote is in the option
field.
{
"voter_name": "La Spata, Daniel",
"voter": {
"name": "La Spata, Daniel",
"id": "ocd-person/c521845f-551b-40a7-97eb-57284773f1a9",
"biography": "",
"death_date": "",
"gender": "",
"national_identity": "",
"extras": "{}",
"family_name": "",
"created_at": "2019-06-07T13:44:33.669",
"locked_fields": "[]",
"given_name": "",
"sort_name": "",
"birth_date": "",
"image": "https://chicago.legistar.com/View.ashx?M=P&ID=217135&GUID=67B0CCE6-7542-4177-A3B8-4A3A91B4484C",
"updated_at": "2019-07-17T23:11:26.991",
"summary": ""
},
"option": "yes",
"note": ""
},