接口地址

https://api.vvhan.com/api/avatar

返回格式

JSON

請求方式:

GET

請求示例(圖片)

https://api.vvhan.com/api/avatar

請求示例(JSON)

https://api.vvhan.com/api/avatar?type=json

請求示例(男頭)

https://api.vvhan.com/api/avatar?class=nan

請求示例(女頭)

https://api.vvhan.com/api/avatar?type=nv

請求示例(動漫)

https://api.vvhan.com/api/avatar?type=dm

請求示例(景物)

https://api.vvhan.com/api/avatar?class=jw

參數說明

名稱 必填 類型 說明
type string 是否輸出JSON
class string 頭像種類

返回數據

{"success":true,"class":"女頭","avatar":"https:\/\/img.4ce.cn\/star3\/origin\/a3e14a9b84715a46e4832bd9f34d3dc7.png"}

調用實例

自行調用

示例代碼

<?php
header("Content-Type:text/json;charset=UTF-8"); date_default_timezone_set("PRC"); $type = $_GET["type"]; $class = $_GET["class "]; $url = "https://api.vvhan.com/api/avatar?type=" . $type . "&class=" . $class; $data = file_get_contents($url); echo $data;
?>