电脑/手机壁纸
正常手机或电脑壁纸
接口详情
请求地址
https://gy.owyun.cn/api/wallpaper/
示例地址
https://gy.owyun.cn/api/wallpaper/?apikey=你的API密钥&type=pc&format=json&num=10
请求方式
GET
返回格式
application/json
请求参数说明
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
| apikey | 可选 | string | 用户密钥 | |
| type | 可选 | string | pc=电脑壁纸,android=手机壁纸 | pc |
| format | 可选 | string | 不输入默认返回图片,可填json | json |
| num | 可选 | string | json返回图片的数量,默认5 | 10 |
示例代码
<?php
$url = 'https://gy.owyun.cn/api/wallpaper/';
$params = [
'apikey' => 'YOUR_VALUE',
'type' => 'YOUR_VALUE',
'format' => 'YOUR_VALUE',
'num' => 'YOUR_VALUE',
];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = "https://gy.owyun.cn/api/wallpaper/"
params = {
"apikey": "YOUR_VALUE",
"type": "YOUR_VALUE",
"format": "YOUR_VALUE",
"num": "YOUR_VALUE",
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL("https://gy.owyun.cn/api/wallpaper/");
const params = {
"apikey": "YOUR_VALUE",
"type": "YOUR_VALUE",
"format": "YOUR_VALUE",
"num": "YOUR_VALUE",
};
Object.keys(params).forEach((key) => url.searchParams.append(key, params[key]));
fetch(url)
.then((response) => response.text())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
返回示例
暂无返回示例,可在“在线调试”中查看实时返回结果。
在线调试
此处将显示接口返回结果...