how can I retrieve the region and the city from an ip? I have found this service: http://api.hostip.info/?ip=xyz.qwe.rty
But It doesn't give me accurate info like this: http://www.ipaddresslocation.org/
Do you know some free service? I need to retrieve this info with a php script, but I wouldn't install external library.
Thank you so much
You may try this.
This is my favourite:
ipinfodb
http://ipinfo.io, my service, gives you city, country and other related information about an IP:
Here's a PHP example:
Free Geolocation API http://ip-api.com/docs/
You can get information about your ip-address, country, region, city, isp, organization.
Response formats and examples: XML, JSON, CSV, PHP.
Usage limits: Our system will automatically ban any IP addresses doing over 240 requests per minute.
PHP Example
if you want to retrieve the city of an IP through http://www.ipaddresslocation.org/ you follow this tutorial: https://www.facebook.com/Websitedevelopar/posts/468049883274297 But you change the RegEx with this string:
BYE