-3

i want to know how to trace someone accessing my website using his/her ip-address. because if there's a code then i want it to insert in my website to deny the users from some countries to access my website.

jaze cara
  • 9
  • 2
  • 1
    Possible duplicate of [What is the most accurate way to retrieve a user's correct IP address in PHP?](https://stackoverflow.com/questions/1634782/what-is-the-most-accurate-way-to-retrieve-a-users-correct-ip-address-in-php) – l'L'l Nov 22 '19 at 05:51

1 Answers1

2

You can use the API mentioned below to get ip address details. This API is free. https://www.iplocate.io/api/lookup/8.8.8.8

Where 8.8.8.8 is the ip address and you can replace it according to your user IP address. It will result like

{"ip":"8.8.8.8","country":"United States","country_code":"US","city":null,"continent":"North America","latitude":37.751,"longitude":-97.822,"time_zone":"America/Chicago","postal_code":null,"org":"Google LLC","asn":"AS15169","subdivision":null,"subdivision2":null}

frianH
  • 7,295
  • 6
  • 20
  • 45
developerKumar
  • 1,706
  • 10
  • 14