稳定、快速、免费的 API 接口服务
直接调用工信部官方查询备案(带缓存)
接口地址: https://api.ooomn.com/api/icp
返回格式: json
请求方式: GET,POST
请求示例: https://api.ooomn.com/api/icp?domain=qq.com
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
domain | 是 | string | 输入需查询域名 |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
name | string | 返回主办单位名称 |
siteindex | string | 返回网站首页网址 |
nature | string | 返回主办单位性质 |
icp | string | 返回网站备案号 |
sitename | string | 返回网站名称 |
time | string | 返回审核时间 |
返回示例:
{ "code": 200, "msg": "success", "name": "深圳市腾讯计算机系统有限公司", "siteindex": "qq.com", "nature": "企业", "limitAccess": "否", "icp": "粤B2-20090059-5", "time": "2022-11-16 09:55:47" }
请求参数设置:
参数名称 | 参数值 | 操作 |
---|---|---|
{ "code": 200, "msg": "success", "name": "深圳市腾讯计算机系统有限公司", "siteindex": "qq.com", "nature": "企业", "limitAccess": "否", "icp": "粤B2-20090059-5", "time": "2022-11-16 09:55:47" }
错误码格式说明:
名称 | 类型 | 说明 |
---|---|---|
200 | string | 查询成功 |
201 | string | 未查询到备案 |
202 | string | 请输入参数domain或查询的域名 |
203 | string | 服务器请求频率过高,请稍后再试 |
代码示例:
<?php
header("Content-Type:text/json;charset=UTF-8");
$domain = $_GET['domain'];
$api = "https://api.ooomn.com/api/icp?domain=" . $domain;
$url = YunTu($api);
echo $url;
function YunTu($url)
{
$ch = curl_init();
$timeout = 30;
$ua= $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$urls = $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER,$urls);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$ip));
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
?>