getCatalogTag
获取一个标签
规范 tag。include=intros 会加入各语言的 tag 描述;include=children 会加入直接子 tag;include=descendants 会加入它下面的全部 tag(即 exclude_tag_tree 对这个 id 额外排除的那些),include=ancestors 会加入它上面的全部 tag,每个节点都带 parent_ids,足以画出整棵树。parents、child_count 与 descendant_count 给出该 tag 在 tag 层级中的位置。可匿名调用,按 IP 地址限流;应用密钥或带 catalog:read 的用户访问令牌各有更高的额度。
/v2/catalog/tags/{id}catalog:read可匿名调用(不带凭据按 IPv4 地址或 IPv6 /64 限流(默认 30 次/分钟、1,000 次/天);带 nmk_ 应用密钥或带 catalog:read 的用户访问令牌则走各自更高的额度)参数
| 参数 | 类型 | 位置 | 说明 |
|---|---|---|---|
id 必填 | string | path | 十进制 catalog id。 |
nsfw | string | query | true 包含 r18。false 或缺省则隐藏 r18。仅 true 或 false。 |
view | string | query | basic(默认)或 full。封闭词表。 |
include | string | query | 逗号分隔的块。未知 token 返回 400 UNKNOWN_INCLUDE。 |
fields | string | query | 逗号分隔的顶层键。未知 token 返回 400 UNKNOWN_FIELD。object 与 id 始终保留。 |
响应
ancestorsobject[]该 tag 上面任意深度的全部 tag,每个只列一次,由近到远;第一层就是 parents。每个节点的 parent_ids 列出它的全部直接父 tag,足以画出到每个根的每条路径。读者只要用 exclude_tag_tree 屏蔽了其中任何一个,带有本 tag 的作品就不会出现在他面前。仅在 include=ancestors 时出现,且只在详情面。根 tag 为空数组。
display_namestring必填不得用作判别条件。
idstring必填catalog tag id。
is_sexualboolean必填该 tag 是否属于性相关族。
objectstring必填类型判别字段。恒为 tag。
枚举tagparent_idsstring[]必填该 tag 在所属这棵树内的直接父 tag,升序。从不为 null。
child_countintegerint64 必填直接子 tag 数。
childrenobject[]直接子 tag,按 id 排序。仅在 include=children 时出现,且只在详情面。没有时为空数组。
display_namestring必填不得用作判别条件。
idstring必填catalog tag id。
is_sexualboolean必填该 tag 是否属于性相关族。
objectstring必填类型判别字段。恒为 tag。
枚举tag
descendant_countintegerint64 必填其下任意层级的 tag 数,每个只计一次。
descendantsobject[]该 tag 下面任意深度的全部 tag,每个只列一次,由近到远(按最短路径,再按 id);长度等于 descendant_count。每个节点的 parent_ids 列出它在「本 tag 与其他后代」之中的直接父 tag,足以画出这棵子树;有多个父 tag 的节点在每个父下都画一次。这些就是 exclude_tag_tree 对这个 id 额外排除的 tag。仅在 include=descendants 时出现,且只在详情面。没有时为空数组。
display_namestring必填不得用作判别条件。
idstring必填catalog tag id。
is_sexualboolean必填该 tag 是否属于性相关族。
objectstring必填类型判别字段。恒为 tag。
枚举tagparent_idsstring[]必填该 tag 在所属这棵树内的直接父 tag,升序。从不为 null。
display_namestring必填不得用作判别条件。
idstring必填catalog tag id。
introsobject[]标签简介,每种语言一条。仅当 include=intros 时出现,且仅在详情面。没有则为空数组。此处 is_machine 恒为 false:存储层不携带标签简介的出处,因此 false 记录的是未知,而不是人工撰写。
is_machineboolean必填该简介是否机翻。
langstringbcp47 必填BCP-47 语言标签。
sourcestring必填开放词表来源。不得用作判别条件。
valuestring必填不得用作判别条件。
is_sexualboolean必填该 tag 是否属于性相关族。向 SFW 读者渲染 tag 列表前请先按此过滤。
objectstring必填类型判别字段。恒为 tag。
枚举tagparentsobject[]必填直接父 tag,按 id 排序。根 tag 为空数组。永不为 null。层级来自投影到规范 tag 上的 VNDB tag 树,外加为 VNDB 没有的 tag 人工审核补充的边;一个 tag 可以有多个父 tag。
display_namestring必填不得用作判别条件。
idstring必填catalog tag id。
is_sexualboolean必填该 tag 是否属于性相关族。
objectstring必填类型判别字段。恒为 tag。
枚举tag
tag_kindstring必填标签词表类别。
枚举contentmetatierstring必填标签库存档位。
枚举corelongtailhiddenwork_countintegerint64 必填在同一 nsfw 下、不加其他筛选时,GET /v2/catalog/works?tag_id={id} 列出的作品数,以每小时一次的重算为准。
请求示例
curl "https://api.nextmoe.dev/v2/catalog/tags/1"