cURL
curl "https://api.ruseo.cn/api/tx?type=1&imgtype=2"
随机返回各类头像图片,支持男生、女生、情侣、动漫、萌宠等多种类型。
https://api.ruseo.cn/api/tx
接口调用前需要确认的核心配置。
/api/txtx必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
type |
否 | integer | 返回格式,1=JSON,2=TXT,默认1 | 1 |
imgtype |
否 | integer | 头像类型:0=综合,1=男生,2=女生,3=情侣,4=闺蜜,5=动漫,6=萌宠,7=可爱,8=欧美,9=古风,10=沙雕,11=仙女,12=简单,13=QQ,14=微信,15=文字,16=个性,默认0 | 2 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/tx?type=1&imgtype=2
curl "https://api.ruseo.cn/api/tx?type=1&imgtype=2"
$url = 'https://api.ruseo.cn/api/tx?type=1&imgtype=2';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/tx?type=1&imgtype=2')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "tx",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 状态码,200成功,400错误 | 200 |
msg |
string | 图片地址或错误信息 | https://res.apihz.cn/img/tx/xxx.jpg |
点击左侧“发送请求”查看结果...