Geocoding with Google Collab, Python, Geocodio
Check out the YouTube Walkthrough
Link to Google Collab notebook
If you want a quick, cheap (maybe free), and scalable way to geocode, then you’ve come to the right place. Let’s walk through each step of the notebook linked above.
Step 1: Upload CSV of Addresses
We’re using Pandas to handle the upload. You can modify this to grab a Google Sheet from your Google Drive. You can also connect Pandas to a variety of other inputs (including databases).
Step 2: Specify Address Column and API Key
Make sure all your address data is contained within a single column. The name you specify for the address column is case sensitive.
Go to Geocodio’s website to request an API key. They let you do 2,000 rows/day for free. Their site does pricing and quality comparisons with other geocode providers. Overall they seem like a great option for US and Canada addresses. A single POST request can handle 10,000 lookups.
Step 3: Send API Request to Geocodio
Geocodio has a Python API, but I prefer to use Python’s native Requests library.
Step 4: Parse the results
Geocodio returns a JSON array/object containing the lat and long. We then parse it into a Pandas DataFrame.
Step 5: Download Results as CSV
Similar to the input step, we have many options for what we can do with the output.
Hope this was helpful and see you next time!