views:

194

answers:

3

I'd like to use WIPmania's API to map IP address. http://www.wipmania.com/en/api/

Does anyone know how to grab the value returned in PHP?

For example the url (http://api.wipmania.com/123.45.67.89?google.com) returns the country code KR.

If it was returning an XML file I'd be alright, but this has confused me.

Thanks in advance.

A: 

Ah I found a better service that returns an XML file - apparently it's more accurate too.

FYI - http://ipinfodb.com/ip%5Flocation%5Fapi.php

logic-unit
A: 

No, ipinfodb.com isn't accurate because based on maxmind. See http://www.wipmania.com/en/blog/why-worldip-data-rather-than-whois-data-examples/

You can work easy with Wipmania API: www.wipmania.com/en/blog/source-code-to-access-to-api/

+1  A: 

Thanks for spreading WIPmania, didn't knew about their web-services. To answer your question:

$country = file_get_contents('http://api.wipmania.com/123.45.67.89?google.com'); // KR
Alix Axel