UIGF API 文档 #1
Replies: 11 comments 20 replies
-
Beta Was this translation helpful? Give feedback.
-
可能还需要这些 gacha type 的翻译。 |
Beta Was this translation helpful? Give feedback.
-
@TremblingMoeNew 有想法么 |
Beta Was this translation helpful? Give feedback.
-
语言参数建议还是和祈愿项的
|
Beta Was this translation helpful? Give feedback.
-
item_type的”角色“、”武器“,以及uigf_gacha_type的”角色活动祈愿和角色活动祈愿-2“(虽然这个不会出现在原始数据表/JSON里)也需要提供翻译文本 |
Beta Was this translation helpful? Give feedback.
-
这个 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
最近在摸鱼,暂时不打算跟进新规范。 |
Beta Was this translation helpful? Give feedback.
-
接口只作翻译用吗?是否允许加点别的接口,比如返回全部卡池之类的? 我在米游社翻了翻似乎只从 活动祈愿历史记录 看见了一个最新角色卡池的接口: https://api-takumi.mihoyo.com/common/blackboard/ys_obc/v1/gacha_pool?app_sn=ys_obc 这里面五星的名字好处理,四星就有些麻烦了。页面上其他的卡池信息似乎也只是被当成了普通帖子的内容,以传统艺能的 html-in-json 形式返回了。 如果做 UP 抽数期望分析之类的就需要自行维护卡池信息,感觉有些笨拙了,不知道 UIGF API 能否代劳呢 💕🤣 |
Beta Was this translation helpful? Give feedback.
-
API: https://api.uigf.org/dict/[LANGUAGE].json
It is necessary to add an api to confirm whether the json file is up to date. 很有必要有一个新的 API 来确保 json 文件的实时性, 否则, 为了使用最新的 json 文件每次都要从新下载. such as: https://api.uigf.org/dict/json-update.json
or return:
The client saves the update date to local disk after calling this API and compares the dates to decide if it should be downloaded next time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
UIGF API
请求审阅,判断接口是否符合需求
介绍
在接下来的统一可交换祈愿记录标准版本中,我们计划将
item_id
的优先度提高,成为必填的字段。这将允许 UIGF 数据集支持国际服的多语言环境,进而将更多的原神工具连接在一起。
但是,一些程序运行于受限的环境中,在将祈愿获取物品名称转化为物品 ID 的过程中有困难。所以 UIGF-Org 提供了一个用于翻译物品文本的 API,供需要该资源的任何开源程序使用。
本 API 已开源于 UIGF-org/UIGF-API,采用 Dimbreath/GenshinData 作为数据源。
使用
UIGF API 有三个常用接口,示例如下
对于所有
lang
参数,目前可接受的语言参数包括:zh-cn
,zh-tw
,de-de
,en-us
,es-es
,fr-fr
,id-id
,ja-jp
,ko-kr
,pt-pt
,ru-ru
,th-th
,vi-vn
chs
,cht
,de
,en
,es
,fr
,id
,jp
,kr
,pt
,ru
,th
,vi
翻译接口
https://api.uigf.org/translate/{lang}/{text}
神里绫华
[神里绫华,神里绫人]
Json
,item_id
键的值即为对应物品 IDHTTP 404 NOT FOUND
错误Json
,item_id
的值为一个整数值列表,列表中每一个 ID 对应请求的物品文本0
的 IDHTTP 404 NOT FOUND
错误::: tabs
@tab 单条查询
https://api.uigf.org/translate/chs/神里绫华
@tab 单条查询结果
@tab 多条查询
https://api.uigf.org/translate/chs/[神里绫华,神里绫人,一个不存在的角色,神里绫人]
@tab 多条查询结果
:::
语言判断接口
该接口用于当无法判断原始文本语言时使用,不应该依赖其作为物品文本和物品 ID 之间的批量转换
https://api.uigf.org/generic-translate/{text}
神里绫华
Json
item_id
键的值即为对应物品 IDlang
键的值为一个列表,其包含找到的对应语言。通常情况,该列表仅会有一个语言代码。但在少数情况下,一个文本可能在多个语言下代表同一个物品。这种情况下,列表中会有多个语言代码。
HTTP 404 NOT FOUND
错误::: tabs
@tab 样例
https://api.uigf.org/generic-translate/神里绫华
@tab 返回值
:::
字典下载接口
对于有能力在服务端或用户端进行物品文本和物品 ID 转换的工具,我们推荐减少对 UIGF 在线翻译 API 的依赖。
你可以通过字典下载接口获取到各个语言的物品文本和物品 ID 转换关系的 Json 文件
https://api.uigf.org/dict/{lang}.json
all
以获取包含全部语言的字典::: tabs
@tab 样例
https://api.uigf.org/dict/jp.json
@tab 返回值
Beta Was this translation helpful? Give feedback.
All reactions