{ "reason": "查询成功", "result": { "lotteryResList": [{ "lottery_id": "ssq", "lottery_res": "03,08,11,14,18,23,16", "lottery_no": "18028", "lottery_date": "2018-03-13", "lottery_exdate": "2018-05-11", "lottery_sale_amount": "352,015,830", "lottery_pool_amount": "578,094,167" }, { "lottery_id": "ssq", "lottery_res": "02,07,09,14,18,28,05", "lottery_no": "18027", "lottery_date": "2018-03-11", "lottery_exdate": "2018-05-09", "lottery_sale_amount": "386,579,026", "lottery_pool_amount": "561,561,972" }, { "lottery_id": "ssq", "lottery_res": "04,07,12,14,26,32,04", "lottery_no": "18026", "lottery_date": "2018-03-08", "lottery_exdate": "2018-05-06", "lottery_sale_amount": "341,958,742", "lottery_pool_amount": "537,930,372" }, { "lottery_id": "ssq", "lottery_res": "04,13,16,19,21,25,14", "lottery_no": "18025", "lottery_date": "2018-03-06", "lottery_exdate": "2018-05-04", "lottery_sale_amount": "341,614,936", "lottery_pool_amount": "513,258,146" }, { "lottery_id": "ssq", "lottery_res": "11,19,22,26,31,32,02", "lottery_no": "18024", "lottery_date": "2018-03-04", "lottery_exdate": "2018-05-02", "lottery_sale_amount": "373,443,496", "lottery_pool_amount": "436,102,047" }], "page": 1, "pageSize": 5, "totalPage": 447 }, "error_code": 0 }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2020/06/06 17:26 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'http://zhouxunwang.cn/data/?id=102&key=AasdQzGd7hN&lottery_id=ssq'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "http://zhouxunwang.cn/data/?id=102&key=AasdQzGd7hN&lottery_id=ssq" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }