接口地址
https://api.vvhan.com/api/ian
返回格式
JSON
请求方式:
GET
请求示例(直接输出):
https://api.vvhan.com/api/ian
请求示例(JSON输出):
https://api.vvhan.com/api/ian?type=json
请求示例(JS输出):
https://api.vvhan.com/api/ian?type=js
请求示例(动漫分类):
https://api.vvhan.com/api/ian?cl=ac
请求示例(文学分类):
https://api.vvhan.com/api/ian?cl=wx
参数说明
名称 | 必填 | 类型 | 说明 |
---|
|
type | 否 | string | 要输出的格式 |
cl | 否 | string | 分类 |
返回数据
动漫文学,网络鸡汤,文学诗词等
调用实例
<script type="text/javascript" src="https://api.vvhan.com/api/ian?type=js"></script><script>vhan()</script>
示例代码
<?php
error_reporting(0);
header('Content-type:text/json;charset=utf-8;');
$hitokoto = $_GET['type'];
$class = $_GET['cl'];
$result = file_get_contents("https://api.vvhan.com/api/ian?type={$hitokoto}&cl={$class}");
echo ($result);
?>