Such information should be free, thus we provide openly an MMDB file.
An IP address has two country locations: one physical where the device is hosted, and one logical from data in whois.
Everyday, the file is rebuilt and made available for download. Make sur to click on Download button to get the update link.
curl 'https://www.geolocus.io/api/ip/3.144.252.138'