The Bing™ Maps REST Services Application Programming Interface (API) provides a Representational State Transfer (REST) interface to perform tasks such as creating a static map with pushpins, geocoding an address, retrieving imagery metadata, or creating a route. Using Geocoder you can retrieve Bing’s geocoded data from Bing Maps REST Services.


>>> import geocoder # pip install geocoder
>>> g ='Mountain View, CA', key='<API KEY>')
>>> g.json

Reverse Geocoding

>>> import geocoder
>>> g =[45.15, -75.14], method='reverse')
>>> g.json

Command Line Interface

$ geocode 'Mountain View, CA' --provider bing
$ geocode '45.15, -75.14' --provider bing --method reverse

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 BING_API_KEY=<Secret API Key>


  • location: Your search location you want geocoded.
  • key: use your own API Key from Bing.
  • maxRows: (default=1) Max number of results to fetch
  • method: (default=geocode) Use the following:
    • geocode
    • reverse