Ready to get started?

Join Adocasts Plus for $8/mo, or sign into an existing Adocasts Plus account, to get access to all of our lessons.

robot mascot smiling

How To Get City and State Info from User’s IP Address using IP2Location

In This Lesson

We'll learn how to get our user's city, region, and country location information using their IP address.

Created by
@tomgobich
Published

Today we’ll see how we can get our user’s city, state, and country location information using their IP address and a from a free library and database called IP2Location.

Since, when working locally in NodeJS/AdonisJS our IP address is going to be localhost (127.0.0.1), I’ve gone ahead and grabbed three different IP addresses from my VPN for us to use as examples.

  • Chicago, United States: 107.150.29.169

  • Frankfurt, Germany: 45.87.212.78

  • Stockholm, Sweden: 149.50.216.74

Join the Discussion 0 comments

Create a free account to join in on the discussion
robot comment bubble

Be the first to comment!