#cli #geolocation

app geolocate

A CLI for geolocation data providers

13 releases (stable)

5.3.2 May 13, 2023
5.3.1 Mar 7, 2023
5.3.0 Feb 26, 2023
4.0.1 Feb 20, 2023
0.2.5 Sep 6, 2022

#922 in Command line utilities

Download history 2/week @ 2023-10-24 15/week @ 2023-10-31 18/week @ 2023-11-14 13/week @ 2023-11-21 67/week @ 2023-11-28 17/week @ 2023-12-05 13/week @ 2023-12-12 26/week @ 2023-12-26 13/week @ 2024-01-02 52/week @ 2024-01-30

52 downloads per month

MIT license

454 lines


Geolocate is a CLI app to fetch geolocation data from various providers. Currently, we support ip2location and ipgeolocation. If you'd like others to be supported, you're welcome to create a feature request.


Geolocate compiles on stable. There are multiple ways to install it:


You should start with getting some API tokens for at least one of the supported providers. Both ip2location and ipgeolocation have a free tier. You can save them with geolocate config --edit. This command will open the configuration file with you favourite editor where you will have to add the tokens. IMPORTANT: The key of the token has to be name of the provider. For example:

ip2location = "yourtokengoeshere"
ipgeolocation = "yourothertokengoeshere"

If you don't do this, geolocate will not recognise them and won't be very useful. Be sure you write correct toml data, but

A subcommand exists for each provider. For example, to fetch geo data for an IP address of from the ipgeolocation provider, you would run the following:

geolocate ipgeolocation

The IP addresses may be IPv4 or IPv6. Geolocate will accept either so long they're correct, but makes no guarantees that the provider accepts them.


~326K SLoC