1. 程式人生 > >基於python的手機號碼歸屬資訊查詢系統

基於python的手機號碼歸屬資訊查詢系統

import json
import requests
num = int(input('請輸入你的手機號:'))
url = 'http://apis.juhe.cn/mobile/get?phone=%s&key=89baea64806cf2020fed945e44a65dd2'%num
rs = requests.get(url)
rs_dict = json.loads(rs.text)
result_dict = rs_dict['result']
pro = result_dict['province']
city = result_dict['city']
areacode = result_dict['areacode'
] zip = result_dict['zip'] compy = result_dict['company'] print('省份:%s 城市:%s 區域號碼:%s 郵編:%s 運營商:%s'%(pro,city,areacode,zip,compy))