geome man page

geome ā€” Get your location based on wifi signals and your IP address using Google Location


geome [-s] [-q] [-h] [-v]


If available, geome queries NetworkManager for its wifi information, such as mac addresses and signal strength, and together with its IP address, sends this information to the Google GeoLocation service to obtain your geographic location.


-k / --key

Specify a Google API key to use. An API key is required to use the API that allows submitting Wifi accesspoints and celltower signal strength information. If not specified, the geome library looks for an api key in the user's ~/.config/geome file. If no apikey is specified or found, an alternative Google API is used based on only the IP address, which is far less acurate

-K / --keyshow

Show the Google API key used.

-q / --quiet / -s / --silent

Quiet or Silent mode. Only return latitude and longitude, separated by a comma, on a single line. Without this option, everything that Google returns is displayed, including latitude, longitude, accuracy, address, country, postal code and more.

-a / --address

Return a human readable address.

-c / --country

Return the country name (eg 'Canada')

-i / --iso

Return the country ISO code (eg 'CA')

-C / --city

Return the city name (eg 'Toronto')

-n / --neighborhood

Return the neighborhood name (eg 'The Bronx')

-j / --json

Return a json string with lat,long and accuracy

-r / --rawjson

Return a json string with lat,long and accuracy

-h / --help

Output help information and exit.

-v / --version

Output version information and exit.


geome works best if it can talk to NetworkManager and obtain a list of nearby Access Points and their strength. If this is unavailable, for instance because NetworkManager is not running, or the computer has no wifi cards, an empty wifi list is sent and Google will return results solely based on the IP address of the request.

Exit Status

geome outputs the location information, if available and exits. The following exit codes are used:




Network connectivity issues, such as broken DNS or blocked HTTP traffic


A captive portal was detected and prevented communication with the Google Location service


Unexpected error or bad Google API key

Library Functions

The geome python module supports the following functions


Set or query the current Google API key. If this function is not used, geome will look for the API key in a file at ~/.config/geome/apikey. Without an API key, wifi and cell tower signals cannot be submitted to google and the position returned will not be very accurate.


Returns a json structure with the location (in lat/long) and accuracy.


Returns the full raw json structure with multiple address locations straight from the Google API


Returns a human readable full address.

geome.my_country(), geome.my_city(), geome.my_country_iso(), my_neighborhood

Returns the respective country, city, country ISO code and neighborhood name


Cell tower strength sending has not yet been implemented. When google returns more then one location component, only the first location of location_type APPROXIMATE is used.


This is really a stripped down version of geolocation-cli written by Francis Markham and available at <>.

Mangled by Paul Wouters <>


November 11, 2012 Paul Wouters Internet / geolocation