Baidu

Baidu Maps Geocoding API is a free open the API, the default quota one million times / day.

Geocoding

>>> import geocoder # pip install geocoder
>>> g = geocoder.baidu('中国', key='<API KEY>')
>>> g.json
...

Command Line Interface

$ geocode '中国' --provider baidu

Environment Variables

To make sure your API key is store safely on your computer, you can define that API key using your system’s environment variables.

$ export BAIDU_API_KEY=<Secret API Key>

Parameters

  • location: Your search location you want geocoded.
  • key: Baidu API key.
  • method: (default=geocode) Use the following:
    • geocode