接口地址
https://api.vvhan.com/api/view
返回格式
JSON
請求方式:
GET
請求示例(圖片輸出):
https://api.vvhan.com/api/view
請求示例(JSON輸出):
https://api.vvhan.com/api/view?type=json
參數說明
| 名稱 | 必填 | 類型 | 說明 |
|---|---|---|---|
| type | 否 | string | 要輸出的格式 |
返回數據
{"code": "200","viewurl": "http:\/\/url.vvhan.com\/viewimg\/api.vvhan.com[16].jpg","width": "2048","height": "1152","size": "jpg"}
調用實例
<img src="https://api.vvhan.com/api/view" alt="韓小韓API">
示例代碼
<?php
header('Content-type:text/json;charset=utf-8;'); date_default_timezone_set("PRC"); $url = "https://api.vvhan.com/api/view"; $type = $_GET['type']; if ($type == "json") { $result = file_get_contents($url . "?type=json"); echo $result; } else { header("Location:" . $url); }
?>