Skip to content
gakada edited this page Mar 2, 2021 · 24 revisions

Don't be evil.

Where to get the data

You can get latest data dumps from the following links (updated once every 24 hours):

For resetting collections archived data dumps for previous months are available from https://db.poi.moe/dump/.

How to use the data

All these datasets are exported via mongodump. For large-size datasets, they are in BSON format (inside MongoDB archive). An efficient way to make use of them is to set up a local MongoDB server and import the data with mongorestore, then query data with a MongoDB binding for your preferred language (see also awesome-mongodb for other libraries, GUI, etc.).

For example, for ship drops collection

# download the current dump
curl -O https://api.poi.moe/dump/dropshiprecords.gz
# make directory for MongoDB
mkdir db
# start MongoDB
mongod --dbpath db
# in another terminal, import data from the archive
# extracted data will be stored inside the created directory and used by MongoDB
mongorestore --gzip --archive=dropshiprecords.gz -d poi-production
# query from MongoDB with any client

Alternatively, the data can be processed directly as BSON

# download and extract the current dump
curl -O https://api.poi.moe/dump/dropshiprecords.gz
gunzip dropshiprecords.gz
# read BSON starting from its offset in the archive, see, e.g.
# http://bsonspec.org/spec.html
# https://www.npmjs.com/package/stream-bson

API

Server is running on https://api.poi.moe/.

All APIs are following the same format:

  • URL: https://[SERVER_NAME]/api/report/v2/[API_NAME]
  • Method: POST
  • Body: data=[JSON_PAYLOAD] or pure json object { data: [payload] }
  • Content-Type: application/json is recommended
  • Header: to support scenarios where User-Agent could not be set (e.g. in browser), we support a custom header X-Reporter to specify the reporter info

where SERVER_NAME is currently api.poi.moe. See the following sections for possible API_NAME values.

JSON_PAYLOAD is the JSON encoded / serialized data you are supposed to send,

Update: we now recommend sending pure json payload. its content varies depending on API_NAME, see the following sections for details.

Construction

URL: https://[SERVER_NAME]/api/report/v2/create_ship
Field Type Explanation
items [Number] Items for construction, from api_item1 to api_item5 in KanColle game api
kdockId Number Dock ID, examples: [0, 3], note the index is 0-based, if you get it from KanColle API's api_kdock_id field, you need to minus 1 from it.
secretary Number Secretaryship's ship_id
shipId Number Result ship id
highspeed Number use highspeed. [0, 1, 10]
teitokuLv Number Game player's level
largeFlag Boolean Set to true if it was LSC(大型舰建造)
origin String (Optional) It's the name of your report plugin, requests' User-Agent will be used if not present

Development

URL: https://[SERVER_NAME]/api/report/v2/create_item
Field Type Explanation
items [Number] (Same as construction)
secretary Number (Same as construction)
itemId Number api_slot_item.api_slotitem_id on success. If development failed, api_fdata will be a comma separated list, get the second element from it (e.g. if api_fdata = "2,33", you should fill this field with 33)
teitokuLv Number (Same as construction)
successful Boolean (Successful or unsuccessful.)
origin String (Same as construction)

Drop ship

URL: https://[SERVER_NAME]/api/report/v2/drop_ship
Field Type Explanation
shipId Number api_get_ship.api_ship_id, dropped ship id, -1 if nothing
itemId Number api_get_useitem.api_useitem_id, dropped item id, -1 if nothing
mapId Number api_maparea_id * 10 + api_mapinfo_no, current map id, 5-5 is 55, 1-6 is 16, etc.
quest String api_quest_name, name of the current map
cellId Number api_no, id of the current edge (path leading from previous to current node)
enemy String api_enemy_info.api_deck_name, name of the current node (enemy's fleet deck)
rank String api_win_rank, battle win rank, 'S', 'A', 'B', 'C', 'D' or 'E'
isBoss Boolean api_color_no == 5, true if it is a boss node, false otherwise
teitokuLv Number (Same as construction)
mapLv Number api_eventmap.api_selected_rank, current map difficulty, 0 for regular (non-event) maps, 1 for 丁, 2 for 丙, 3 for 乙, 4 for 甲
enemyShips1 [Number] api_ship_ke, ship ids of the main enemy fleet
enemyShips2 [Number] api_ship_ke_combined, ship ids of the escort enemy combined fleet (if any, [] otherwise)
enemyFormation Number api_formation[1], enemy fleet formation id
baseExp Number api_get_base_exp, base ship experience got
teitokuId String sha1(api_member_id + '_' + api_nickname + '_' + api_nickname_id) in base64, a hash unique per player
shipCounts [Number] for shipId != -1 stores all owned forms of that ship as [base count, first remodel count, ...]
origin String (Same as construction)

Item remodel recipe

URL: https://[SERVER_NAME]/api/report/v2/remodel_recipe
Field Type Explanation
recipeId Number recipe id, note that 101, 201, 301 will not be reported
itemId Number item to improve
stage Number improve stage, [0,6) = 0, [6, 10) = 1, 10 = 2
day Number day of week UTC+9 Tokyo/Japan
secretary Number ship id of second slot, determined by api_req_kousyou/remodel_slot's api_voice_ship_id
fuel Number 0 if no fuel consumed
ammo Number similar to above
steel Number similar to above
bauxite Number similar to above
reqItemId Number item id for consumed items, will be -1 if no item consumed
reqItemCount Number 0 if no item consumed
buildkit Number cannot be 0
remodelkit Number cannot be 0
certainBuildkit Number cannot be 0
certainRemodelkit Number cannot be 0
upgradeToItemId Number id for new item upgraded, only possible at stage 2, -1 if no information
upgradeToItemLevel Number level for new item upgraded, -1 if no information
key String key to identify recipe, r${recipeId}-i${itemId}-s${stage}-d${day}-s${secretary}
origin String (Same as construction)

The client will fetch known recipes from server and only report new ones, see poi-plugin-report's implementation.

TODO: document other endpoints.

Implementations

Several KanColle tools/plugins have implemented supports for this, you can refer to them when in question: