前言
本文转自:https://api.mvpsky.com/docs/api-1.html
https://api.mvpsky.com 是我随手写的一个网站,聚合了多种api(还在继续肝)
这个网站需要大家共同完成
例如:动漫图片api里面的动漫图片需要大家提交后才会显示,所以如果您对此项目有兴趣欢迎加入我们
发起请求
请求方式: get
post
请求地址:https://api.mvpsky.com/api/free/你在本站的userkey/pic/返回格式/图片地址类型
Userkey
userkey申请地址:https://api.mvpsky.com/admin/user/key/see 直接点击创建keys
返回格式
可选txt
json
view
txt : 以文本格式输出图片链接
json : 以json格式输出图片链接
view : 直接显示图片
图片地址类型
local => 图片由本站托管
source => 图片源地址
为空 => 图片由本站托管
<script> alert(“1”) </script>
调用代码
PHP调用代码
<?php $userkey="af94fafc654e281c2c02a066a54fc734"; # api.mvpsky.com userkey $returntype="view"; #返回格式 json txt view $returnc="local"; # 图片地址类型 local source switch ($returntype) { case 'json': print_r($url=json_decode(file_get_contents("https://api.mvpsky.com/api/free/$userkey/pic/$returntype/$returnc"),true)['imgurl'][$returnc]); break; case 'txt': echo $url=file_get_contents("https://api.mvpsky.com/api/free/$userkey/pic/$returntype/$returnc"); break; case 'view': header('content-type:image/jpg;'); echo $url=file_get_contents("https://api.mvpsky.com/api/free/$userkey/pic/$returntype/$returnc"); break; } ?>
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
喜欢就支持以下吧