cURL
curl "https://api.ruseo.cn/api/checkurl?url=https%3A%2F%2Fexample.com&types=links&timeout=5&external=false&codes=404%2C500&limit=50"
检测网页中的链接状态,抓取页面提取所有超链接/图片/脚本/CSS等,逐个检查HTTP状态码,报告死链数量及详情,支持外链过滤、超时设置、链接类型筛选
https://api.ruseo.cn/api/checkurl
接口调用前需要确认的核心配置。
/api/checkurlcheckurl必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
url |
是 | string | 要检测的页面URL | https://example.com |
types |
否 | string | 链接类型links/images/scripts/styles/all默认links | links |
timeout |
否 | number | 每个链接超时秒数默认5 | 5 |
external |
否 | string | 是否只检测外链默认false | false |
codes |
否 | string | 判定为死链的状态码默认404,500,502,503,504,0 | 404,500 |
limit |
否 | number | 最大检测链接数默认100 | 50 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/checkurl?url=https%3A%2F%2Fexample.com&types=links&timeout=5&external=false&codes=404%2C500&limit=50
curl "https://api.ruseo.cn/api/checkurl?url=https%3A%2F%2Fexample.com&types=links&timeout=5&external=false&codes=404%2C500&limit=50"
$url = 'https://api.ruseo.cn/api/checkurl?url=https%3A%2F%2Fexample.com&types=links&timeout=5&external=false&codes=404%2C500&limit=50';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/checkurl?url=https%3A%2F%2Fexample.com&types=links&timeout=5&external=false&codes=404%2C500&limit=50')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "checkurl",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
success |
boolean | 是否成功 | true |
total_links |
number | 检测链接总数 | 25 |
dead_count |
number | 死链数量 | 3 |
alive_count |
number | 正常链接数量 | 22 |
dead_links |
array | 死链列表 | |
alive_links |
array | 正常链接列表 | |
点击左侧“发送请求”查看结果...