稳定、快速、高效的 API 接口服务
在线获取网站title
接口地址: https://api.svipk.com/api/title/
返回格式: JSON
请求方式: GET/POST
请求示例: https://api.svipk.com/api/title/?apiKey=后台获取的秘钥&url=api.svipk.com
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
url | 是 | string | 输入网站名称,例如:api.svipk.com |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
success | string | 返回状态:是否成功 |
title | string | 目标网站标题 |
返回示例:
{ "success":true, "title":"江湖API聚合" }
错误码格式说明:
名称 | 类型 | 说明 |
---|---|---|
message | string | 错误提示! |
代码示例:
<?php
header("Content-Type:text/html;charset=UTF-8");
date_default_timezone_set("PRC");
$url= "www.jianghu.cool";
$result = file_get_contents("https://www.jianghu.cool/api/img/?apiKey=后台获取的秘钥&qq=".$url);
$arr=json_decode($result,true);
if ($arr['success']=="true") {
echo "网站名称:".$arr['title'];
} else {
echo $arr['message'];
}
?>