接口地址

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;
?>