接口地址:https://api.istero.com/resource/hoilday/query |
---|
返回格式:json |
请求方式:get |
请求示例:https://api.istero.com/resource/hoilday/query?token=TOKEN&year=2024 |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
token | string | 必填 | 第三方平台token 扫码关注公众号 |
year | int | 必填 | 查询的年份 |
名称 | 类型 | 说明 |
---|---|---|
name | string | 节日名称 |
hoilday | string | 法定假日 |
{
"code": 200,
"data": [{
"name": "元旦",
"hoilday": [
"2023-12-30",
"2023-12-31",
"2024-01-01"
]
},
{
"name": "春节",
"hoilday": [
"2024-02-10",
"2024-02-11",
"2024-02-12",
"2024-02-13",
"2024-02-14",
"2024-02-15",
"2024-02-16",
"2024-02-17"
]
},
{
"name": "清明节",
"hoilday": [
"2024-04-04",
"2024-04-05",
"2024-04-06"
]
},
{
"name": "劳动节",
"hoilday": [
"2024-05-01",
"2024-05-02",
"2024-05-03",
"2024-05-04",
"2024-05-05"
]
},
{
"name": "端午节",
"hoilday": [
"2024-06-10"
]
},
{
"name": "中秋节",
"hoilday": [
"2024-09-15",
"2024-09-16",
"2024-09-17"
]
},
{
"name": "国庆节",
"hoilday": [
"2024-10-01",
"2024-10-02",
"2024-10-03",
"2024-10-04",
"2024-10-05",
"2024-10-06",
"2024-10-07"
]
}
],
"message": ""
}
错误码 | 说明 |
---|---|
400 | 数据返回错误,“message”显示错误信息 |
401 | TOKEN为空 |
402 | 接口不存在 |
403 | 接口请求失败 |
404 | TOKEN错误/鉴权失败 |
405 | IP白名单规则拦截 |
406 | Referer白名单规则拦截 |
407 | 接口维护中 |
408 | 接口已停止服务 |
500 | 接口服务器错误 |
501 | 余额不足,仅付费接口会出现此状态码 |
502 | 违反平台协议,账号被封锁 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2024/11/27 22:11
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://api.istero.com/resource/hoilday/query?token=TOKEN&year=2024';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://api.istero.com/resource/hoilday/query?token=TOKEN&year=2024"
)
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))
}