voterInfoQuery

144 views
Skip to first unread message

Jason Putorti

unread,
Apr 25, 2022, 6:50:46 PM4/25/22
to Google Civic Information API
In the docs, electionId is listed as an optional parameter. https://developers.google.com/civic-information/docs/v2/elections/voterInfoQuery

However in reality, if an electionId is not specified, this is returned:
{ "error": { "code": 400, "message": "Election unknown", "errors": [ { "message": "Election unknown", "domain": "global", "reason": "invalid" } ] } }

Specifying any electionID, even one that's in a different state than the address provided, will work and allow basic info. to be returned.

Mekesia Brown

unread,
Oct 12, 2022, 3:43:00 PM10/12/22
to Google Civic Information API
Same issue is happening for me to. Makes me feel good to know that someone else experienced this. Hope we find out what is happening!

In a local PHP curl request I tried the Kansas example address from the "Using the API  |  Civic Information API  |  Google Developers" link:

          $test = "https://www.googleapis.com/civicinfo/v2/voterinfo?address=1263%20Pacific%20Ave.%20Kansas%20City%20KS&electionId=2000&key=" . $civic_info_api_key;

          $ch = curl_init($test);

          curl_exec($ch);

          $info = curl_getinfo($ch); 

          print_r($info);

And that works fine and dandy, but w/o the electionID I get nothing but  "Election unknown"s.

If I could use this API it would be so great for a non-profit I'm making this for. I hope there's better documentation soon, or at least more param options for location-targeted election info.

Justin Quizon

unread,
Oct 14, 2022, 12:31:59 PM10/14/22
to Google Civic Information API
Hi all,

Thank you for flagging this! I was able to replicate the scenario in question, we will verify internally if this is expected behavior based on the provided query.

If you have any additional samples where you are seeing this behavior, please feel free to send it over to our team!

Regards,
Justin

Mekesia Brown

unread,
Oct 14, 2022, 12:34:28 PM10/14/22
to Google Civic Information API
Oh thank you so much Justin!

Mekesia

Justin Quizon

unread,
Oct 18, 2022, 2:50:55 PM10/18/22
to Google Civic Information API
Hi folks,

In checking with our internal teams, they have informed me that this may be affected by the amount of information available for the region you are trying to run the query for. You should be able to perform the query without the electionID in places like Wyoming or Virginia. This should get better with other states as more data becomes available over time.

However, we do recommend adding the electionID as it is typically is better to be more specific to get the data you are looking for.

Hope this helps!

Regards,
Justin

Reply all
Reply to author
Forward
0 new messages