Have you ever used one of the services to get your own ip? Ipify is one of these services, and you can try it yourself using the following command.
Now, the question is: how much does it cost to run such a service? And how much would it take to scale it to that point?
This article is a great example of how a simple code and service could become something much bigger and how can you improve your code to improve its scalability, also with the help of Heroku.