GET /avatars/generate
从种子字符串(如用户名或邮箱)生成唯一头像图片 URL。返回来自三种不同服务的 URL:DiceBear(17 种艺术风格,SVG/PNG)、UI Avatars(基于首字母)和 RoboHash(机器人/怪物)。相同的种子始终生成相同的头像,非常适合作为用户资料默认头像。
seed
必填
Seed string (username, email, any text)
style
可选
默认: avataaars
DiceBear style name
size
可选
默认: 200
Image size in pixels
| 名称 | 必填 | 默认值 | 描述 |
|---|---|---|---|
seed |
是 | - | Seed string (username, email, any text) |
style |
否 | avataaars | DiceBear style name |
size |
否 | 200 | Image size in pixels |
curl "https://nordapi.ee/api/v1/avatars/generate?seed=john_doe"
curl "https://nordapi.ee/api/v1/avatars/generate?seed=john_doe"
curl "https://nordapi.ee/api/v1/avatars/generate?seed=jane&style=pixel-art&size=400"
curl "https://nordapi.ee/api/v1/avatars/generate?seed=user@example.com&style=bottts"
{
"data": {
"dicebear": "https://api.dicebear.com/9.x/avataaars/svg?seed=john_doe&size=200",
"dicebear_png": "https://api.dicebear.com/9.x/avataaars/png?seed=john_doe&size=200",
"robohash": "https://robohash.org/john_doe?size=200x200",
"robohash_monster": "https://robohash.org/john_doe?set=set2&size=200x200",
"robohash_robot_head": "https://robohash.org/john_doe?set=set3&size=200x200",
"seed": "john_doe",
"size": 200,
"style": "avataaars",
"ui_avatar": "https://ui-avatars.com/api/?name=john_doe&size=200&background=random&color=fff"
},
"success": true
}