Skip to content

The application takes an IP address as input and retrieves information such as country, city, region, ISP name, geolocation (latitude,longitude), postal code, timezone, response_time etc.

Notifications You must be signed in to change notification settings

partho5/ip-location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ip-location

Simpliest way to get user's location using their IP address.

The application takes an IP address as input and retrieves information such as country, city, region, ISP name (org), geolocation (latitude,longitude), postal code, timezone, response_time etc. This project demonstrate to do so using PHP. But you can implement in any language by using curl .

How to use :

Clone the repository

git clone https://github.com/partho5/ip-location.git
  1. Open index.php file. There you replace the sample IP with your IP address for which you want to find location.
  2. You need to get an API key from https://api.iplocation.net . It's free, though they have paid features. Anyway simply signup and you will get an API key. No card information required as of the time of writing this instruction (August 14, 2023).

Create a file named config.php and write :

<?php

    define('IPINFO_API_KEY', 'API KEY obtained from api.iplocation.net');

Now host the project in your server or localhost. Visit index.php file.
Sample output I got :

'response screenshot'

About

The application takes an IP address as input and retrieves information such as country, city, region, ISP name, geolocation (latitude,longitude), postal code, timezone, response_time etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages