from ip2geotools.databases.noncommercial import DbIpCity ip='147.229.2.90' response = DbIpCity.get(ip, api_key='free') response.to_json()