cURL
curl "https://api.ruseo.cn/api/names_check?name=%E6%9D%9C%E5%BA%B7"
提供姓名,可查询全国同名男女的总数量
https://api.ruseo.cn/api/names_check
接口调用前需要确认的核心配置。
/api/names_checknames_check必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
name |
是 | string | 需要查询的姓名 | 杜康 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/names_check?name=%E6%9D%9C%E5%BA%B7
curl "https://api.ruseo.cn/api/names_check?name=%E6%9D%9C%E5%BA%B7"
$url = 'https://api.ruseo.cn/api/names_check?name=%E6%9D%9C%E5%BA%B7';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/names_check?name=%E6%9D%9C%E5%BA%B7')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "names_check",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
string | 状态码 | 0 |
msg |
string | 状态信息 | success |
data |
string | 返回内容 | |
name |
string | 查询的姓名 | 杜康 |
count |
string | 总人数 | 12345 |
male |
string | 男性占比 | 52.3% |
female |
string | 女性占比 | 47.7% |
点击左侧“发送请求”查看结果...