DEV Community

Joe Steinbring
Joe Steinbring

Posted on • Originally published at blog.jws.app on

1 1

How to get a user’s IP Address using just JavaScript (and an API call)

I have used IP Chicken for checking my public IP Address for pretty much 15 years (since hearing about it on TechTV). Once upon a time, I tried writing my own alternative in ColdFusion but it is a lot of overhead for such a dumb thing. I started wondering if I could do it with just JavaScript.

This is one way? :)

It uses a service that CloudFlare offers, Vue.js, and Axios. The data that CloudFlare returns isn’t JSON but you can do some substrings to get what you need.

I will likely return to this at some point. I think that there is a better method.

Also, I created ip.jws.app (because why not?) if you want to see these concepts in action.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More