| 接口地址:https://test.harumoe.cn/api/other/icp |
|---|
| 返回格式:json |
| 请求方式:get |
| 请求示例:https://test.harumoe.cn/api/other/icp?domain=free-api.com |
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| domain | string | 必填 | 域名 |
| type | string | 选填 | chinaz、yudinet,两种方式可选 |
| domain | string | 选填 | 是否获取缓存数据(默认缓存48小时) |
| lang | string | 选填 | 语言类型(zh-cn、ru-ru、en-us、ja-jp、ko-kr) |
| 名称 | 类型 | 说明 |
|---|---|---|
| unit | string | 主办单位名称 |
| nature | string | 主办单位性质 |
| name | string | 网站名称 |
| index | string | 网站域名 |
| time | string | 审核日期 |
{
"code": 200,
"msg": "数据请求成功!",
"data": {
"unit": "***",
"nature": "个人",
"copy": "",
"name": "免费api",
"index": "www.free-api.com",
"time": "2019-06-11 16:36:09"
}
}| 错误码 | 说明 |
|---|---|
| 204 | 数据为空 |
| 400 | 格式错误 |
| 403 | 无权限 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2023/06/05 14:26
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://test.harumoe.cn/api/other/icp?domain=free-api.com';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://test.harumoe.cn/api/other/icp?domain=free-api.com"
)
func main() {
queryUrl := fmt.Sprintf("%s",APIURL)
resp, err := http.Get(queryUrl)
if err != nil {
log.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}