IP details finder without third party API

Find visitor ip details like country, city, region, latitude and longitude without using any api services with slim framework.

Share on Social Media



A tiny service to get IP details such as 

  1. Country
  2. City
  3. Postal code
  4. Latitude
  5. Longitude
  6. Region and more..

It is not required any third party api. And its based on slim framework

Installation steps

Install composer by using following command at app root folder by using following command.

composer install

Change logs folder permission to 777

sudo chmod 777 -R logs/

Then, configure web server for example nignx configuration

server {
        listen 80;
        root /usr/share/nginx/html/ip-details/public;
        index index.php index.html index.htm;
        server_name ip-details.dev;

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        location ~ \.php$ {
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                include snippets/fastcgi-php.conf;

How to use:

it is restful service 

API Uri: /ip-details

Method: POST

Request Body:

    "ip": ""


"country_code": "IN",
"country_code3": "IND",
"country_name": "India",
"region": null,
"city": null,
"postal_code": null,
"latitude": 20,
"longitude": 77,
"area_code": null,
"dma_code": null,
"metro_code": null,
"continent_code": "AS",
"ip": ""


Not yet reviewed

Question or Comment

No support questions or comments