REST API, GET, POST

API kullanılarak JSON formatında bilgiler alma

IP Example PC’nin IPsini öğrenip nereye kayıtlı olduğu bilgisini aldık. import requests, json ip = requests.get('http://icanhazip.com/').text.strip() print(ip) geoip_info = json.loads(requests.get('http://ip-api.com/json/' + ip).text) print(geoip_info['query'], geoip_info['country'], geoip_info['city'], geoip_info['as']) A.B.C.D A.B.C.D Turkey Ankara res.json() ve json.loads(res.text) her ikisi de dict formatını veriyor. import requests, json ips = ['1.1.1.1', '8.8.8.8', '9.9.9.9'] for ip in... [Read More]

Python Ipaddress Library

The ipaddress module includes classes for working with IPv4 and IPv6 network addresses. The classes support validation, finding addresses and hosts on a network, and other common operations [Read More]