接口地址:https://www.mxnzp.com/api/lottery/common/aim_lottery |
---|
返回格式:json |
请求方式:get |
请求示例:https://www.mxnzp.com/api/lottery/common/aim_lottery?expect=18135&code=ssq&app_id=your&app_secret=your |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
app_id | string | 必填 | app_id 扫码关注公众号 |
app_secret | string | 必填 | app_secret 扫码关注公众号 |
expect | string | 必填 | 彩票期号 |
code | string | 必填 | 彩票种类标识,目前提供七种彩种, ssq:双色球,qlc:七乐彩,fc3d:福彩3D,cjdlt:超级大乐透,qxc:七星彩,pl3:排列3,pl5:排列(5) |
名称 | 类型 | 说明 |
---|---|---|
openCode | string | 本期中奖号码 |
code | string | 彩票编号标识 |
expect | string | 彩票期号 |
name | string | 彩票名称 |
time | string | 发布时间 |
{
"code": 1,
"msg": "数据返回成功!",
"data": {
"openCode": "03,06,10,11,27,33+03",
"code": "ssq",
"expect": "2019135",
"name": "双色球",
"time": "2019-11-24 21:18:20"
}
}
错误码 | 说明 |
---|---|
0 | app_id或者app_secret不合法 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2022/06/01 11:38
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://www.mxnzp.com/api/lottery/common/aim_lottery?expect=18135&code=ssq&app_id=your&app_secret=your';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://www.mxnzp.com/api/lottery/common/aim_lottery?expect=18135&code=ssq&app_id=your&app_secret=your"
)
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))
}