I use MaxMind API to get IP Address data. What I am looking for is the country and the ASN. The MaxMind API works as follow: curl -s http://geoip.maxmind.com/e\?l\={APIKEY}\&i\={IP} And returns something like this: US,"United States",AZ,Arizona,Phoenix,33.5097,-112.0678,753,602,America/Phoenix,NA,85012,"Highwinds Network Group","Highwinds Network Group",,"AS20446 Highwinds Network Group, Inc.",Corporate,hosting,1000,99,20,60,10,%
To get the Country I use the following: loc=`curl -s http://geoip.maxmind.com/e\?l\={APIKEY}\&i\={IP} 2>&1 | awk -F',' '{print $1;}'
I want to be able to grab the ASN info. In this case that would be "AS20446 Highwinds Network Group, Inc."
How can I do that?