Below APIs provide a free IP Geo Location API for software developers. It uses a database of IP addresses that are associated with cities along with other relevant information like time zone, latitude and longitude.
https://ipgeolocationapi.com/
https://freegeoip.app/
https://github.com/thehowl/ip.zxq.co
https://db-ip.com/api/free.php