AI万能翻译

通过调用大模型进行AI智能翻译,适配DeepL调用,可自定义传入与目标语言

GET 正常
7
总调用次数
100%
成功率
2025-12-04
创建时间
2025-12-05
最后更新

请求信息

GET https://api.izhar.cn/API/aitr.php
https://api.izhar.cn/API/aitr.php?text=你好&source_lang=zh&target_lang=ug&apikey=用户密钥

请求参数

4 个参数
参数名 类型 必填 说明
text string 内容
source_lang string 翻译原语言
target_lang string 目标语言
apikey string 用户密钥

在线测试

响应结果

就绪
等待请求...

状态码说明

状态码 说明 含义
200 请求成功 服务器已成功处理了请求
400 错误请求 服务器无法理解请求的格式
401 未授权 请求要求身份验证
403 禁止访问 服务器拒绝请求(权限不足)
404 未找到 请求的资源不存在
429 请求过多 超出速率限制,请稍后再试
500 服务器错误 服务器遇到错误,无法完成请求

调用示例

<?php
$url = 'https://api.izhar.cn/API/aitr.php';
$params = [
    'text' => 'VALUE',
    'source_lang' => 'VALUE',
    'target_lang' => 'VALUE',
    'apikey' => 'VALUE',
];

$ch = curl_init();
$url .= '?' . http_build_query($params);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/x-www-form-urlencoded'
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $data = json_decode($response, true);
    print_r($data);
} else {
    echo "请求失败,状态码:$httpCode";
}
?>
import requests

url = "https://api.izhar.cn/API/aitr.php"
params = {
    "text": "VALUE",
    "source_lang": "VALUE",
    "target_lang": "VALUE",
    "apikey": "VALUE",
}

response = requests.get(url, params=params)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"请求失败,状态码:{response.status_code}")
const url = 'https://api.izhar.cn/API/aitr.php';
const params = new URLSearchParams({
    'text': 'VALUE',
    'source_lang': 'VALUE',
    'target_lang': 'VALUE',
    'apikey': 'VALUE',
});

const requestOptions = {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    },
};

const requestUrl = `${url}?${params.toString()}`;

fetch(requestUrl, requestOptions)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        console.log('Response:', data);
    })
    .catch(error => {
        console.error('Error:', error);
    });
curl -X GET "https://api.izhar.cn/API/aitr.php?text=VALUE&source_lang=VALUE&target_lang=VALUE&apikey=VALUE"