Is there a way to only filter out certain countries when downloading the IP to Geolocation DB?
You can apply a filter using “grep” if you are only interested in a particular country. Here is an example to do this for the US:
$ curl -L https://ipinfo.io/data/location.csv.gz?token=$TOKEN | gzip -d | cat | grep ',US,' > location-US.csv $ head -10 location-US.csv 109.105.194.0,109.105.194.255,109.105.0.0,Ashburn,Virginia,US,39.0437,-77.4875,20149,America/New_York 109.105.195.0,109.105.195.255,109.105.0.0,Chicago,Illinois,US,41.85003,-87.65005,60666,America/Chicago 109.105.196.0,109.105.196.255,109.105.0.0,Ashburn,Virginia,US,39.0437,-77.4875,20149,America/New_York 109.105.198.0,109.105.198.255,109.105.0.0,Ashburn,Virginia,US,39.0437,-77.4875,20149,America/New_York 109.105.208.0,109.105.215.255,109.105.0.0,Boston,Massachusetts,US,42.35843,-71.05977,02108,America/New_York 109.105.216.0,109.105.223.255,109.105.0.0,Chicago,Illinois,US,41.8119,-87.6873,60680,America/Chicago 109.105.96.117,109.105.96.118,109.105.0.0,Ashburn,Virginia,US,39.04372,-77.48749,20147,America/New_York 109.105.96.119,109.105.96.120,109.105.0.0,New York City,New York,US,40.71427,-74.00597,10004,America/New_York 109.105.96.29,109.105.96.30,109.105.0.0,McLean,Virginia,US,38.93428,-77.17748,22101,America/New_York 109.105.97.134,109.105.97.134,109.105.0.0,Tysons Corner,Virginia,US,38.91872,-77.23109,22027,America/New_York