chircollab / chircollab20

Home for the 2020 Chicago R Collab event
https://chircollab.github.io/
10 stars 3 forks source link

package idea: google civic information API package #15

Open willdebras opened 4 years ago

willdebras commented 4 years ago

There used to be a package to interface with the Google Civic Information API, but it got removed from CRAN, as I believe it became defunct when Google started requiring keys generated from GCP for all their various APIs. The API lets one get information about polling locations, get political geography and information about representatives and districts, and more.

Seeing this tweet I wrapped one of the endpoints for getting polling location into a small package, but it could be a cool project for one of two people to take a day and wrap all the endpoints into a package. It could be useful in helping others share and find civic information as lots of primary elections and the 2020 general elections come up. It could be used to make shiny apps to lookup polling locations or contact information for local, state, and national representatives.

nataliablock commented 4 years ago

Hey @willdebras that's a pretty good idea! It's been a while that I've worked with an API, this can be a good opportunity to refresh my memory and learn a bit more. Can I reach you in case I get stuck?

willdebras commented 4 years ago

Absolutely! You certainly can reach me. I can just give you write access to this repo if you want to work on it during/outside of the collab at all! It is a good baseline with one endpoint wrapped and has some links to the API info itself.

nataliablock commented 4 years ago

That would be great! Thank you! Let’s see what happens with the in-person event, but we can still do digital collab 😉

nataliablock commented 4 years ago

Hi @willdebras ! So, I've been playing around with the Google Civic API and your package today. I had some issues with the get_voterinfo function because of the API. It seems that the election ID is not optional, it's mandatory. It is probably a recent change. I ran your example and it didn't work. Did some research and found out that you necessarily need to include the election ID. However, I had some problems with the elections endpoint. Decided to go ahead and develop a function to get representatives by address but it seems that this endpoint is not populated.

I'm not sure how the conference will be, but I'm still up to work on this project. Let me know what do you think.

Have a great rest of your week and see you on Saturday!

willdebras commented 4 years ago

This is bizarre! This endpoint changed it seems. It used to not require an election ID, but I am definitely still down to work on this! Talk to you shortly!