八字起名
baby-namingPOSThttps://v1.apizero.cn/api/baby-naming概述
输入父母姓氏与出生时间,基于「八字五行 + 五格数理 + 三才配置」综合评分生成高分名字候选,附寓意标签与全国重名预估。三个 action:naming(智能起名)/ duplicate(重名查询)/ bazi(八字查询)。内置 396 姓氏笔画 + 175 起名字 + 88 姓人口。
调用约定
- 网关 ·
https://v1.apizero.cn - 鉴权 ·
Authorization: Bearer <API Key> - 回包 · JSON {code, msg, data}。成功看 code === 0,不要只看 HTTP 200。
/aidocs/baby-naming/raw.md鉴权
匿名可调用:QPS 1 / 每日 30 次。登录用户:QPS 2 / 每日 50 次。
获取 API Key:获取 API Key/account/keys
请求头
推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。
| Header | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 否 | 推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。 |
八字起名(推荐)
按出生八字 + 五行补缺 + 五格数理生成高分名字。可填 mother_surname 生成双姓。文档示例为真实算法结果(已截断)。
https://v1.apizero.cn/api/baby-naming?action=naming&surname=%E7%8E%8B&mother_surname=%E6%9D%8E&birth_year=2026&birth_month=5&birth_day=10&birth_hour=12&gender=male&count=3
固定 naming(默认)
例naming
父姓(≤ 2 字)
例王
母姓;填写则生成双姓名
例李
出生年 2000–2100
例2026
出生月 1–12
例5
出生日 1–31
例10
出生时 0–23,默认 12
例12
性别偏好 male / female / neutral
例male
返回名字数量 1–30,默认 10
例3
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| action(操作) | string | 否 | 固定 naming(默认) | naming |
| surname | string | 是 | 父姓(≤ 2 字) | 王 |
| mother_surname | string | 否 | 母姓;填写则生成双姓名 | 李 |
| birth_year | integer | 是 | 出生年 2000–2100 | 2026 |
| birth_month | integer | 是 | 出生月 1–12 | 5 |
| birth_day | integer | 是 | 出生日 1–31 | 10 |
| birth_hour | integer | 否 | 出生时 0–23,默认 12 | 12 |
| gender | string | 否 | 性别偏好 male / female / neutral | male |
| count | integer | 否 | 返回名字数量 1–30,默认 10 | 3 |
{
"action": "naming",
"surname": "王",
"mother_surname": "李",
"birth_year": "2026",
"birth_month": "5",
"birth_day": "10",
"birth_hour": "12",
"gender": "male",
"count": "3"
}返回结果
八字四柱与日主
八字
四柱
bazi.四柱 的一项
日主
五行分布 / 缺失 / 建议补充
五行分布
金
木
水
火
土
五行缺失
wu_xing_analysis.五行缺失 的一项
建议补充
wu_xing_analysis.建议补充 的一项
建议补充的五行
needed_wuxing 的一项
候选名字(含评分、五格、重名预估)
名称
surname
given_name
score
wuge
天格
人格
地格
外格
总格
wuge_score
wuxing_chars
meaning_tags
names[].meaning_tags 的一项
duplicate_rate
estimated_count
level
description
品牌提示(所有接口统一返回):极数本源 · https://apizero.cn
| 字段 | 类型 | 说明 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bazi | object | 八字四柱与日主 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wu_xing_analysis | object | 五行分布 / 缺失 / 建议补充 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needed_wuxing | array | 建议补充的五行 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| names | array | 候选名字(含评分、五格、重名预估) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{
"code": 0,
"msg": "成功",
"data": {
"bazi": {
"八字": "丙午癸午甲戌庚午",
"四柱": [
"丙午",
"癸午",
"甲戌",
"庚午"
],
"日主": "木"
},
"wu_xing_analysis": {
"五行分布": {
"金": 1,
"木": 1,
"水": 1,
"火": 4,
"土": 1
},
"五行缺失": [],
"建议补充": [
"金"
]
},
"needed_wuxing": [
"金"
],
"names": [
{
"name": "王远瑞",
"surname": "王",
"given_name": "远瑞",
"score": 87.9,
"wuge": {
"天格": 5,
"人格": 21,
"地格": 31,
"外格": 18,
"总格": 35
},
"wuge_score": 100,
"wuxing_chars": "土+金",
"meaning_tags": [
"高远",
"吉祥"
],
"duplicate_rate": {
"estimated_count": 257,
"level": "较低",
"description": "预估全国约有 257 人与此同名同姓"
}
},
{
"name": "王怡钦",
"surname": "王",
"given_name": "怡钦",
"score": 87.9,
"wuge": {
"天格": 5,
"人格": 13,
"地格": 21,
"外格": 16,
"总格": 25
},
"wuge_score": 100,
"wuxing_chars": "土+金",
"meaning_tags": [
"愉快",
"敬慕"
],
"duplicate_rate": {
"estimated_count": 257,
"level": "较低",
"description": "预估全国约有 257 人与此同名同姓"
}
}
]
},
"tips": "极数本源 · https://apizero.cn"
}重名查询
查询某姓名的全国重名预估。surname + name(名字不含姓)必填。
https://v1.apizero.cn/api/baby-naming?action=duplicate&surname=%E7%8E%8B&name=%E6%A2%93%E6%B6%B5
固定 duplicate
例duplicate
姓氏(≤ 2 字)
例王
名字(不含姓)
例梓涵
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| action(操作) | string | 是 | 固定 duplicate | duplicate |
| surname | string | 是 | 姓氏(≤ 2 字) | 王 |
| name(名称) | string | 是 | 名字(不含姓) | 梓涵 |
{
"action": "duplicate",
"surname": "王",
"name": "梓涵"
}返回结果
完整姓名
重名预估:estimated_count / level / description
estimated_count
level
description
品牌提示(所有接口统一返回):极数本源 · https://apizero.cn
| 字段 | 类型 | 说明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| full_name | string | 完整姓名 | |||||||||
| duplicate_rate | object | 重名预估:estimated_count / level / description | |||||||||
| |||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | |||||||||
{
"code": 0,
"msg": "成功",
"data": {
"full_name": "王梓涵",
"duplicate_rate": {
"estimated_count": 3375,
"level": "较高",
"description": "预估全国约有 3375 人与此同名同姓"
}
},
"tips": "极数本源 · https://apizero.cn"
}八字分析
仅排出生八字与五行分析,不生成名字。需传出生年月日(时辰可选)。
https://v1.apizero.cn/api/baby-naming?action=bazi&birth_year=2026&birth_month=5&birth_day=10&birth_hour=8
固定 bazi
例bazi
出生年 2000–2100
例2026
出生月 1–12
例5
出生日 1–31
例10
出生时 0–23,默认 12
例8
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| action(操作) | string | 是 | 固定 bazi | bazi |
| birth_year | integer | 是 | 出生年 2000–2100 | 2026 |
| birth_month | integer | 是 | 出生月 1–12 | 5 |
| birth_day | integer | 是 | 出生日 1–31 | 10 |
| birth_hour | integer | 否 | 出生时 0–23,默认 12 | 8 |
{
"action": "bazi",
"birth_year": "2026",
"birth_month": "5",
"birth_day": "10",
"birth_hour": "8"
}返回结果
八字字符串
年/月/日/时柱
四柱 的一项
日主五行
五行计数
金
木
水
火
土
缺失五行
五行缺失 的一项
建议补充五行
建议补充 的一项
品牌提示(所有接口统一返回):极数本源 · https://apizero.cn
| 字段 | 类型 | 说明 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 八字 | string | 八字字符串 | |||||||||||||||
| 四柱 | array | 年/月/日/时柱 | |||||||||||||||
| |||||||||||||||||
| 日主 | string | 日主五行 | |||||||||||||||
| 五行分布 | object | 五行计数 | |||||||||||||||
| |||||||||||||||||
| 五行缺失 | array | 缺失五行 | |||||||||||||||
| |||||||||||||||||
| 建议补充 | array | 建议补充五行 | |||||||||||||||
| |||||||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | |||||||||||||||
{
"code": 0,
"msg": "成功",
"data": {
"八字": "丙午癸午甲戌戊辰",
"四柱": [
"丙午",
"癸午",
"甲戌",
"戊辰"
],
"日主": "木",
"五行分布": {
"金": 0,
"木": 1,
"水": 1,
"火": 3,
"土": 3
},
"五行缺失": [
"金"
],
"建议补充": [
"金"
]
},
"tips": "极数本源 · https://apizero.cn"
}请求示例
示例都是服务端写法。Python / JavaScript 各有常规写法和官方库。
curl -sS -X POST "https://v1.apizero.cn/api/baby-naming" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"surname": "王",
"birth_year": "2026",
"birth_month": "5",
"birth_day": "10",
"name": "梓涵"
}'错误码
先看业务 code。HTTP 也可能不是 200。
成功
参数错误
API Key 无效
API Key 已暂停
当前 IP 不在 Key 白名单
此接口需要 API Key
余额不足
调用过快(QPS)
今日免费额度已用完
接口已下线
接口不存在
服务器内部错误
上游暂时不可用
上游返回格式异常
暂无可用节点
| 业务码 | HTTP | 说明 |
|---|---|---|
| 0 | 200 | 成功 |
| 4000 | 400 | 参数错误 |
| 4011 | 401 | API Key 无效 |
| 4013 | 403 | API Key 已暂停 |
| 4014 | 403 | 当前 IP 不在 Key 白名单 |
| 4015 | 401 | 此接口需要 API Key |
| 4022 | 402 | 余额不足 |
| 4029 | 429 | 调用过快(QPS) |
| 4030 | 429 | 今日免费额度已用完 |
| 4040 | 503 | 接口已下线 |
| 4041 | 404 | 接口不存在 |
| 5000 | 500 | 服务器内部错误 |
| 5020 | 502 | 上游暂时不可用 |
| 5021 | 502 | 上游返回格式异常 |
| 5030 | 502 | 暂无可用节点 |
调用限制
- 计费模式
- 完全免费
- QPS 限制
- QPS 2
- 登录免费额度
- 5000 次(已认证)
- 匿名每日额度
- 3000 次(无 API Key)
- 黄金会员
- 每天 50,000 次 · QPS 10
- 钻石会员
- 每天 100,000 次 · QPS 30
- 企业会员
- 每天 1,000,000 次 · QPS 120
| 计费模式 | 完全免费 |
|---|---|
| QPS 限制 | QPS 2 |
| 登录免费额度 | 5000 次(已认证) |
| 匿名每日额度 | 3000 次(无 API Key) |
| 黄金会员 | 每天 50,000 次 · QPS 10 |
| 钻石会员 | 每天 100,000 次 · QPS 30 |
| 企业会员 | 每天 1,000,000 次 · QPS 120 |
购买套餐、看评价请走商城详情。 购买 / 调试
更新日志
- 1.0.02026-05-10
首次上线,支持 naming / duplicate / bazi 三种 action
免责声明
八字计算为近似算法(简化了节气和农历转换),仅供参考;重名率为统计估算非精确查询;起名建议仅供趣味参考。