19

联通查话费 API

 3 years ago
source link: https://www.v2ex.com/t/805901
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  信息安全

联通查话费 API

  lzhw · 7 小时 25 分钟前 · 941 次点击

转自吾爱。不知道联通不做鉴权直接开放给公网随意查询是否合适。

python:

import requests
import json
# 联通手机号码
phone = "xxxxxxxxxxx"
url = "https://weixin.10010js.com/app/charge/qryRealFee"
headers = {
    "Host": "weixin.10010js.com",
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Content-Length": "23",
    "Accept": "*/*",
    "Referer": "https://weixin.10010js.com/actPage/activity/index28.html?",
    "Accept-Language": "zh-cn",
    "User-Agent": "Mozilla/5.0 (Linux; U; Android 8.1.0; zh-cn; BLA-AL00 Build/HUAWEIBLA-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/8.9 Mobile Safari/537.36"
}
data = {
    "phone": phone
}
req = requests.post(url, json.dumps(data), headers=headers)
money = int(req.text)/100
print(money)
<?php
$url="https://weixin.10010js.com/app/charge/qryRealFee";
$data='{"phone":'.'"'.$_GET["phone"].'"}';
echo "您的帐户余额是:<font color=red size=30>".(curl_post($url,$data)/100)."</font>元人民币";
   function curl_post($url,$data){
     $headers = array(
    "Host:weixin.10010js.com",
    "Content-Type:application/json",
    "Cache-Control:no-cache",
    "Content-Length:23",
    "Accept:*/*",
    "Referer:https://weixin.10010js.com/actPage/activity/index28.html?",
    "Accept-Language:zh-cn",
    "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
);
       $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url); 
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);         
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);    
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $output = curl_exec($ch);
        curl_close($ch);
        return $output;
    }        
?>

有人做好现成的,可以直接试试:

调用地址: http://api.dooper.top:8899/api/liantong/?nub=
请求方式:GET
返回类型:JSON
请求示例: http://api.dooper.top:8899/api/liantong/?nub=13288888888

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK