返回 | 接口 / 文本工具 / 微软翻译API
GET 文本工具

微软翻译API

提供文本翻译功能,支持多国语言互译和语言列表查询

累计调用 9 今日调用 0

更新于 2026-10-16

调用地址

GET
https://itapi.top/api/byfy

请求参数

参数名类型必填说明示例
text string 可选 要翻译的文本内容(可选,不提供时返回支持的语言列表) 测试文本
from int 可选 源语言代码,如en表示英语(可选,默认en) en
to int 可选 目标语言代码,如zh-CHS表示简体中文(可选,默认zh-CHS) zh-CHS
output int 可选 输出格式,json或text(可选,默认json) 测试文本
languages int 可选 查询支持的语言列表(可选,值为1时返回语言列表) 测试文本
test_token int 可选 测试token获取功能(可选,值为1时执行测试) 测试文本

响应示例

200 OK
{
    "success": false,
    "message": "Token获取失败"
}

在线测试

代码示例

cURL · GET
curl "https://itapi.top/api/byfy?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&from=en&to=zh-CHS&output=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&languages=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&test_token=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC"
PHP
<?php
$res  = file_get_contents("https://itapi.top/api/byfy?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&from=en&to=zh-CHS&output=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&languages=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&test_token=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC");
$json = json_decode($res, true);
print_r($json);
JavaScript
const res  = await fetch("https://itapi.top/api/byfy?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&from=en&to=zh-CHS&output=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&languages=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&test_token=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC");
const json = await res.json();
console.log(json);
Python
import requests

r = requests.get("https://itapi.top/api/byfy?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&from=en&to=zh-CHS&output=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&languages=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&test_token=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC", timeout=10)
print(r.json())
返回接口列表