I have been trying to find the latitude and longitude of a list of company-names. For example, the addresses look like this-(1Mobility India Pvt Ltd Pune Maharashtra India), (21st Century Software Solutions Pvt Ltd Visakhapatnam Andhra Pradesh).

I am geocoding using python and I know how to geocode if I am given the complete set of addresses.

For that I use geocoders package from GoogleV3. Using this package however I am able to recover only the latitude and longitude of the city and not the exact location of the company within the city. In Google maps online , however, I can recover the exact lat long for the company.

Does anyone have any experience about which python package to use for batch geocoding when only company names are given or any other way to batch geocode with just names?


2 Answers 2


You don't have to install and configure extra packages.

Just hit the google geocode API with the address separated with '+'. It is a get API and will return the response in a JSON. Then extract the information whatever you want.

import requests

response = requests.get('https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA')

resp_json_payload = response.json()


If it gives any error then just insert the api-key as:

response = requests.get('https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=<API_KEY>')

Make sure your places API key is enabled.


Use the google maps API (requires api key)

from urllib.request import urlopen, Request
from bs4 import BeautifulSoup

# use the google map api
import json

url = 'https://maps.googleapis.com/maps/api/geocode/json?address=Braman+Municipal+Utilities'
jsonurl = urlopen(url)

text = json.loads(jsonurl.read())
print ( text['results'][0]["formatted_address"])
print ( text['results'][0]["geometry"]['location']["lat"])
print ( text['results'][0]["geometry"]['location']["lng"])

Not the answer you're looking for? Browse other questions tagged or ask your own question.