Detect Users IP Address, City and Country

Learn how to find a users IP address, city and country using Corvid (a.k.a. Wix Code). 

This example shows you how to find a users IP address, city and country. This is useful for tracking user activity within your site if they are not authenticated members, or even blocking users from certain countries or who are violating the use policy of your website. The city returned is actually the city in which the ISP is based, not the user. It uses an API call to an external site with a free limit of 50 calls per minute, thereafter you would need to pay a subscription fee. See the example below.

Your IP address is: 52.87.86.158 from Ashburn, United States
#txtUserIP
Please wait ...
Disclaimer: To the best of our knowledge, this code works for its stipulated purpose. If you find an error in our code, or know of a better way to achieve the same result - please contact us! All our code snippets come with full support to help you implement them on your own website - simply contact us for help.
  • Facebook Social Icon
  • MeWe-Fluid-Icon
© CorvidCodeBank