Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Translate zip codes into city + state
function getCityByZip(zip) {
fetch(`https://maps.googleapis.com/maps/api/geocode/json?address=${zip}`)
.then(response => response.json())
.then(response => response.results[0].formatted_address)
.then(console.log)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.