==== What is it: ================================================================================================================== ip2c.org exists to resolve IPs to country codes/names. | + fast and simple URL API + updated daily + has information on over 4,242,640,056 IPv4s » please read Inputs and Outputs sections for instructions Your IP is 100.24.113.182 and it's listed as US United States in today's dataset.
Try it:
This service is FREE (LGPL) because we strongly support technology sharing. FREE does not imply low quality. Our uptime has been 99.95% since the beginning of 2009, courtesy of ultra-simple design. Amount of requests per user / per day is unlimited, just be reasonable. Currently we can sustain a maximum of about 20 million per day.
==== News: ========================================================================================================================
==== Accepted inputs: ============================================================================================================= http://ip2c.org/XXX.XXX.XXX.XXX or http://ip2c.org/?ip=XXX.XXX.XXX.XXX | + standard IPv4 from 0.0.0.0 to 255.255.255.255 + e.g. we take your IP: | + URL looks like this: http://ip2c.org/100.24.113.182 | or | http://ip2c.org/?ip=100.24.113.182 | + resulting string is: 1;US;USA;United States http://ip2c.org/XXXXXXXXXX or http://ip2c.org/?dec=XXXXXXXXXX | + decimal number from 0 to 4294967295 (MAX_INT) + faster than ?ip= option, less server-side processing + to convert IPv4 to decimal you only need to know this: | + (IPv4) A.B.C.D == A*256^3 + B*256^2 + C*256 + D (decimal) + e.g. 5.6.7.8 == 5*256^3 + 6*256^2 + 7*256 + 8 == 5*16777216 + 6*65536 + 7*256 + 8 == 83886080 + 393216 + 1792 + 8 == 84281096 http://ip2c.org/s or http://ip2c.org/self or http://ip2c.org/?self | + processes caller's IP + faster than ?dec= option but limited to one purpose - give info about yourself Caution Some clients (e.g. ASP) may have issues while trying to open a file over HTTP. In that case a slash / preceding ?ip= is obligatory.
==== Possible outputs: ============================================================================================================ 0;;;WRONG INPUT | + your request has not been processed due to invalid syntax | + e.g. bad IPv4 like 300.400.abc.256 + e.g. bad decimal like 2a3b4c or bigger than MAX_INT 1;CD;COD;COUNTRY | + contains two-letter (ISO 3166) and three-letter country codes, and a full country name + country name may be multi-word and contain spaces + e.g. we take your IP: | + URL looks like this: http://ip2c.org/100.24.113.182 | or | http://ip2c.org/?ip=100.24.113.182 | + resulting string is: 1;US;USA;United States 2;;;UNKNOWN | + given ip/dec not found in database or not yet physically assigned to any country The first digit indicates status so you don't have to always parse the whole string. Output is always semicolon delimited text/plain - you can pass it to any type of application.
==== PHP example: ================================================================================================================= $ip = '100.24.113.182'; //or any other IP here $s = file_get_contents('http://ip2c.org/'.$ip); switch($s[0]) { case '0': echo 'Something wrong'; break; case '1': $reply = explode(';',$s); echo '<br>Two-letter: '.$reply[1]; echo '<br>Three-letter: '.$reply[2]; echo '<br>Full name: '.$reply[3]; break; case '2': echo 'Not found in database'; break; }
==== Java example: ================================================================================================================ String ip = "100.24.113.182"; //or any other IP here HttpURLConnection urlcon = (HttpURLConnection)new URL("http://ip2c.org/"+ip).openConnection(); urlcon.setDefaultUseCaches(false); urlcon.setUseCaches(false); urlcon.connect(); InputStream is = urlcon.getInputStream(); int c = 0; String s = ""; while((c = is.read()) != -1) s+= (char)c; is.close(); switch(s.charAt(0)) { case '0': System.out.println("Something wrong"); break; case '1': String[] reply = s.split(";"); System.out.println("Two-letter: " + reply[1]); System.out.println("Three-letter: " + reply[2]); System.out.println("Full name: " + reply[3]); break; case '2': System.out.println("Not found in database"); break; }
==== License: ===================================================================================================================== This service is provided FREE under the terms of the GNU LGPLv3, 29 June 2007 https://www.gnu.org/copyleft/lesser.html This means the service is provided "as is". There is NO WARRANTY WHATSOEVER for the service. Use at your own risk.
==== Notes: ======================================================================================================================= This service uses IP to Country Database (csv) maintained by Webnet77.com http://webnet77.com/contact.html http://software77.net/geo-ip Flag icons come from a free set created by GoSquared https://www.gosquared.com/resources/flag-icons You may contact the author of this service at <mail at ip2c dot org>
==== Statistics: (2020 Nov 23, 16:00 UTC+1) ====================================================================================== 18,121,555,730 requests processed since 2008 Mar 14 599,019 last hour 166.4/s ~47.9% of server load capacity 14,814,093 requests yesterday by 1,979,221 users from 229 countries 15,270,937 last 7 days average 11,432,684 last 30 days average
==== (c)2008-2020 ip2c.org (GeoLoc.daiguo.com) ============================================ IP data: 2020 Nov 23, 16:00 UTC+1 ==== ==== → User of the Month ← ==== x.x.34.48
25,365,054
page stat: 45,526,720
18111988556