Skip to content

v1 ship cg

boholder edited this page Feb 2, 2021 · 1 revision

v1/ship/cg

CG images of the ship girls in PNG format. This API is only used to further request the CGs of the ship girls inquired according to the constructed requests of the ship/cg API in the cg field in the response after querying the ship/info API. Of course, as long as you know the exact parameter values, you can directly construct a request for this API by referring to this document.

PNG格式的舰娘CG图片。 此API仅作为在查询ship/infoAPI后,根据其响应中的cg字段中对ship/cgAPI的构造好的请求, 进一步请求所查询舰娘的图片。 当然只要你知道明确的参数值,你可以参照本文档直接构造对此API的请求。

Request url example 示例URL: http://domain/v1/ship/cg? shipid=1 [& cgid=n1]

1. Parameters 参数

1.1. Overall 一览表

For details, please refer to the corresponding section below.

具体属性介绍请参见下文对应部分。

parameter name must required parameter values default value brief description
shipid Yes custom input N/A represent for one ship's one model, one record in the database
cgid Yes n0 n0-1 n1 n1-1 n2
n3 n8 n9 n10 n11
e{seasonal cg id*} d{seasonal cg id} a
N/A represent for one CG image
  • seasonal cg id is the id in exillusts.nedb, generally you can't get one ship's seasonal cg id before request ship/info API and get response, that's what I said "should request ship/info first".
参数名 是否必须 取值 默认值 简单说明
shipid 用户输入 N/A 该id表示数据库中单个舰娘的单个形态
cgid n0 n0-1 n1 n1-1 n2
n3 n8 n9 n10 n11
e{seasonal cg id*} d{seasonal cg id} a
N/A 表示确切的某张CG
  • seasonal cg idexillusts.nedb 中的id,表示季节限定立绘,一般需要先请求ship/infoAPI才能(从响应中的cg字段) 得知该舰娘的季节限定立绘id,这就是上文所说的不太能直接构造请求的原因。

1.2. shipid (ship id (in the database)) 数据库内舰娘id

must required parameter? 是否必须? Yes
- - -
  • Number format.

  • Represent for one ship's one model, one record in the database.

  • 数字格式

  • 表示数据库中单个舰娘的单个形态

1.3. cgid (CG id)

must required parameter? 是否必须? Yes
- - -
  • String format.

  • Combined with cg type abbreviation and cg number.

    • cgid = first letter for type abbreviation + remain part for cg number.
    • example: cgid = n1-1, type abbreviation=n, cg number=1-1.
  • Type abbreviations:

    • n for normal cg,
    • e for seasonal cg whole_body version,
    • d for seasonal cg whole_body_damaged version,
    • a for mian's screenshot on all cgs of one ship girl.
  • Cg number:

    • for normal cg, number is image file name,
    • for seasonal cg, number is seasonal cg id
      • (seasonal cg id represent a database record, as while as a sub-directory of seasonal cg directory,in where seasonal cg stored)
    • for all-in-one cg (screenshot on all CGs of one ship girl), there is no cg number, we'll search image by ship's Chinese name. (because these files are named in Chinese)
  • 字符串格式

  • cgid 是CG类型缩写CG数字的连接字符串,第一个字母是类型缩写,其余部分是CG数字

    • 举例: example: cgid = n1-1, 类型缩写=n, CG数字=1-1.
  • 类型缩写共4种:

    • n 常规CG,比如普通立绘,卡片形式
    • e 限定立绘的非中破图片
    • d 限定立绘的中破图片
    • a 眠对萌百网页的截图,截图包含了单个舰娘的全部CG,包括常规与限定。
  • CG数字:

    • 对常规CG,数字是图片文件名。
    • 对限定CG,CG是图片目录名。
    • 对眠的截图,需要用shipid查询数据库获取舰娘中文名,因为截图文件是用中文命名的。

2. Response description 响应属性解释

2.1 HTTP status code used in API response 响应资源状态码

HTTP response status codes - MDN web docs

code massage explanation
200 OK The server found ship id exists in database, and successfully found the requested image.
400 Bad Request There is something wrong in request params,
maybe unsupported format, unreasonable value...
readable explanation will be sent with response as body.
404 Not Found Server couldn't find shipid in request in database, or couldn't find requested image, or can't process that image.
500 Internal Server Error Unhandled error occurred when server processing request,
tell the server administrator to check log
or report it as an issue on issue page.

3.Example 例子

Take Shiratsuyu Class Destroyer: Murasame as an example.

以白露型驱逐舰:村雨为例。

Request url: host/v1/ship/cg? shipid=498 & cgid={}

cgid value description image
n0 banner example image
n0-1 banner_masked example image
n1 banner_dmged example image
n1-1 banner_dmged_masked example image
n2 card` example image
n3 card_dmged example image
n8 whole_body example image
n9 whole_body_dmged example image
n10 head_masked example image
n11 head_dmged_masked example image
e20 seasonal_whole_body example image
d20 seasonal_whole_body_dmged example image
a mian's screenshot example image