If you’re building a website (or API) using Flask, it’s often useful to know where your visitors are coming from: the US, the EU, someplace else? The process of locating a web user is typically referred to IP geolocation, and unfortunately, it isn’t simple.
The reason it isn’t easy to get IP geolocation data is that there is no standard mapping of IPs -> location data. Most companies get this data by purchasing it from GeoIP aggregators that piece together lots of different bits of information to build an accurate database of IP geolocation data.
GeoIP data is typically comprised of: