工具·中国名画
中国名画

接口地址: https://58.linkpc.net/doc/painting.html

返回格式: JSON

请求方式: GET

请求示例: https://58.linkpc.net/api/painting

请求参数说明:

名称 必填 类型 说明

返回参数说明:

名称 类型 说明

返回示例:

{
"code": 200,
"msg": "成功",
"data": {
"title": "芭蕉仕女图",
"dynasty": "清",
"source": "任薰",
"info": "清 任薰 任颐 纸本设色 纵125厘米 横31厘米 清华大学美术学院藏",
"img": "https:\/\/cdn.api.52vmy.cn\/api\/painting\/images\/renwu\/488.jpg",
"content": "此画是任薰与任颐合作而成。画法采用勾勒填彩,勾线如铁线银钩,有行云流水之妙而多一种劲健遒丽,芭蕉用没骨法晕染,仕女用线条勾画,颇具特色。"
}
}

错误码格式说明:

名称 类型 说明

代码示例:

<?php
header('Content-type: application/json; charset=utf-8');
date_default_timezone_set('PRC');
$url = 'https://58.linkpc.net/api/painting';
$type = isset($_GET['type']) ? $_GET['type'] : '';
if ($type == 'json' || $type == 'JSON') {
$result = file_get_contents($url . '?type=json');
echo htmlspecialchars($result);
} else {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);