限时免费
接口地址:https://api.sumt.cn/api/bing.php
返回格式:json
请求方式:get
请求示例:https://api.sumt.cn/api/bing.php?token=[尚未登录]&format=json
请求参数说明:
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
| token | 是 | string | 调用接口凭证 |
| idx | 否 | string | 查看历史7天数据 [范围 0-7] |
| size | 否 | string | 指定获取图片大小 |
| 1920x1080 1366x768 1280x768 1024x768 800x600 768x1280 720x1280 640x480 480x800 400x240 320x240 240x320 | |||
| format | 否 | string | 选择输出格式 [json|data|jpg] |
返回参数说明:
| 名称 | 类型 | 说明 |
|---|---|---|
| code | string | 返回的状态码 |
| msg | string | 返回错误信息 |
| time | string | 返回美图时间 |
| title | string | 返回美图标题 |
| img_url | string | 返回美图链接 |
请求返回示例:
{
"code": 200,
"msg": "success",
"data": {
"time": "2020-02-01",
"title": "从上魏斯巴赫山地列车的车站向外看,德国图林根 (© golero\/iStock\/Getty Images Plus)",
"img": "https:\/\/cn.bing.com\/th?id=OHR.OberweissbacherBergbahn_ZH-CN1289048050_1920x1080.jpg"
}
}
服务级错误码参照:
| 错误码 | 说明 |
|---|---|
| 201 | 传递参数不能为空 |
| 202 | 获取必应美图异常 |
| 203 | 传递参数格式不正确 |
系统级错误码参照:
| 错误码 | 说明 |
|---|---|
| 10011 | 密钥错误或不存在 |
| 10012 | 通讯密钥已被封禁 |
| 10013 | 通讯密钥申请注销 |
| 10014 | 地区已被系统屏蔽 |
| 10018 | 请求频率超过限制 |
| 10019 | 请求被限制或封禁 |
| 10021 | 接口异常或者停用 |
| 10022 | 账户密钥额度不足 |
| 10023 | 请求权限暂未开启 |
| 10024 | 请求的地区被屏蔽 |
| 10025 | 请求权限已被拉黑 |
| 10026 | 请求签名校验错误 |
| 10027 | 非白名单请求域名 |
| 10028 | 非白名单的IP地址 |
实例演示代码:
<?php
// API 接口调用示例
// 接口地址
$url = 'https://api.sumt.cn/api/bing.php';
// 请求参数
$data = [
'token' => '通讯密钥',
'format' => 'json',
];
// 发送请求
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
// 输出结果
echo $result;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>API接口调用演示</title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div id="result"></div>
<script>
// 接口地址
const api = "https://api.sumt.cn/api/bing.php";
// 请求参数
const params = {
token: "通讯密钥",
format: "json"
};
// 发送请求
$.ajax({
url: api,
type: "GET",
data: params,
success: function(res) {
$("#result").text(res);
console.log("请求成功:", res);
},
error: function(err) {
$("#result").text(res);
console.log("请求失败");
}
});
</script>
</body>
</html>
// API 接口调用示例
// 接口地址
const apiUrl = "https://api.sumt.cn/api/bing.php";
// 请求参数
const params = {
token: "通讯密钥",
format: "json",
};
// 发送请求
$.ajax({
url: apiUrl,
type: "GET",
data: params,
dataType: "json",
success: function(res) {
console.log("请求成功:", res);
},
error: function(err) {
console.log("请求失败");
}
});
项目信息
0点/¥0元/次
单次对接价格
尚未申请通讯密钥
通讯密钥凭证
2018-07-14 10:11:03
项目创建时间
2021-04-23 09:27:25
最后更新时间
自2018年07月14日,上线以来总累计提供数 2060417 次API接口调用服务。其中,昨日调用数 2 次,今日调用数 2 次。
使用须知
1.本平台提供的所有 API 接口,仅限个人学习、技术研究使用,禁止用于任何商业盈利、经营性项目。
2.禁止利用本接口从事违反《中华人民共和国网络安全法》《互联网信息服务管理办法》等相关法律法规的活动。
3.使用者需自行承担因使用本接口产生的一切法律责任,平台保留对违规使用账号的封禁、限制访问等权利。
4.本接口的技术文档、示例代码等内容的知识产权归平台所有,未经授权不得擅自篡改、传播、售卖。
5.平台有权根据运营情况调整、暂停或终止接口服务,无需提前通知用户。
登录后可发表评论
发表评论
请勿发表违规内容,违者封禁账号
全部评论