API 文档

此 API 旨在提供对指定网站的 HTTP 状态检查以及敏感词检测功能。它允许客户端提交一个或多个 URL,并选择一个或多个敏感词库文件进行内容审查。该 API 还支持验证客户端凭据,以确保只有授权用户能够访问其功能。

端点

获取敏感词库信息

方法: GET

URL: https://safesite.rutno.com/check_url_api?getSources=true

说明: 返回可用的敏感词库列表及其描述信息。

请求参数 (GET)

参数名 类型 必须 描述
getSources bool 设置为 true 以获取敏感词库列表

成功响应

{
    "sources": [
        {
            "name": "违禁词汇库1",
            "description": "这是第一个违禁词汇库。",
            "file": "wg.txt"
        },
        {
            "name": "违禁词汇库2",
            "description": "这是第二个违禁词汇库。",
            "file": "wg2.txt"
        }
    ]
}

示例请求

curl "https://safesite.rutno.com/check_url_api?getSources=true"
提交域名进行检查

方法: POST

URL: https://safesite.rutno.com/check_url_api

请求体: JSON 格式的数据,包含 secret_id, secret_key, domains, 和可选的 sources 字段。

请求参数 (POST)

参数名 类型 必须 描述
secret_id string 客户端的唯一标识符
secret_key string 客户端的密钥
domains array 需要检查的一个或多个域名列表
sources array 敏感词库文件名列表,默认使用所有敏感词库

成功响应

正常情况

{
    "https://example1.com": {
        "status": 200,
        "safe": true,
        "message": "Website is accessible and functioning normally."
    },
    "https://example2.com": {
        "status": 404,
        "message": "The requested page could not be found on the website."
    }
}

包含违禁词汇

{
    "https://example3.com": {
        "status": 200,
        "safe": false,
        "message": "Website contains prohibited words.",
        "prohibited_words": ["word1", "word2"]
    }
}

错误响应

{
    "error": "Invalid credentials or client is banned"
}
{
    "error": "Insufficient requests quota"
}

示例请求

curl -X POST "https://safesite.rutno.com/check_url_api" \
-H "Content-Type: application/json" \
--data-raw '{
    "secret_id": "zko_client",
    "secret_key": "a_very_strong_secret_key",
    "domains": ["https://example1.com", "https://example2.com"],
    "sources": ["wg.txt", "wg2.txt"]
}'

注意事项