The API domain is https://api.mentemori.icu/
[world_id]
parameters are four digit integers of the following format: SWWW
S
: Server. 1 = Japan, 2 = Korea, 3 = Asia, 4 = North America, 5 = Europe, 6 = Global WWW
: World number. For example, W10
is 010
Example: Korea W4 is 2004
.
0
may be passed in for [world_id]
parameters to fetch data for all worlds at once.
S000
may be passed in for [world_id]
parameters to fetch data for all worlds in a server at once.
[wgroup_id]
parameters are world group IDs. These can be found from the /wgroups
endpoint.
[server]
parameters are one of: jp1
, jp2
, jp3
, jp4
, jp5
, kr1
, kr2
, ap1
, ap2
, us1
, eu1
, gl1
, gl2
.
All endpoints return a payload of the following format:
{ "status": 200, "timestamp": 1600000000, "data": ... }
status
HTTP status code timestamp
Timestamp of data returned (not request time) data
Endpoint-dependent payload /worlds
List of worlds with data available, as well as what data is available.
"data": [ { "world_id": 1001, "ranking": true, "temple": false, "localgvg": true }, ... ]
world_id
: Four-digit world ID ranking
: Whether there is up to date data for the player_ranking
, guild_ranking
, and arena
endpoints temple
: Whether there is up to date data for the temple
endpoint localgvg
: Whether there is up to date data for the localgvg
endpoint /wgroups
List of world groups, as well as what data is available.
"data": [ { "group_id": 1, "worlds": [1001, 1002, 1003, 1004], "legendleague": true, "globalgvg": true }, ... ]
group_id
: World group ID worlds
: List of world IDs for worlds in the group legendleague
: Whether there is up to date data for the legend
endpoint globalgvg
: Whether there is up to date data for the globalgvg
endpoints /[world_id]/player_ranking/latest
Player rankings for a world. Includes BP, Player Rank, Story, and Tower rankings.
"data": { "world_id": 1001, "rankings": { "bp": [ { "id": 123456789001, "name": "Player", "bp": 100000000 }, ... ], "rank": [ { "id": 123456789001, "name": "Player", "rank": 400 }, ... ], "quest": [ { "id": 123456789001, "name": "Player", "quest_id": 700 }, ... ], "tower": [ { "id": 123456789001, "name": "Player", "tower_id": 800 }, ... ], "tower_blue": [ { "id": 123456789001, "name": "Player", "tower_id": 800 }, ... ] "tower_red": [ { "id": 123456789001, "name": "Player", "tower_id": 800 }, ... ] "tower_green": [ { "id": 123456789001, "name": "Player", "tower_id": 800 }, ... ] "tower_yellow": [ { "id": 123456789001, "name": "Player", "tower_id": 800 }, ... ] }, "player_info": { "123456789001": { "id": 123456789001, "name": "Player", "bp": 1000000000, "rank": 400, "quest_id": 700, "tower_id": 800, "icon_id": 21, "guild_id": 987654321001, "guild_name": "Guild", "guild_join_time": 1600000000000, "guild_position": 1, "prev_legend_league_class": 5 }, ... } }
world_id
: Four-digit world ID rankings
: ranking data bp
: Ranking data by BP in descending order rank
: Ranking data by Player Rank in descending order quest
: Ranking data by Story stage in descending order quest_id
: Story stage. 1-12
is 12
, 2-1
is 13
, etc.tower
: Ranking data by Tower floor in descending order tower_blue
: Ranking data by Tower of Azure floor in descending order tower_red
: Ranking data by Tower of Crimson floor in descending order tower_green
: Ranking data by Tower of Emerald floor in descending order tower_yellow
: Ranking data by Tower of Amber floor in descending order Worlds for which elemental tower rankings have not been unlocked will return an empty array for those fields.
player_info
: additional player info for players that appeared in rankings
. Dictionary with player id as key. id
: Player ID. Last three digits are world number. name
: Player Name bp
: BP rank
: Player Rank quest_id
: Quest ID. 1-12
is 12
, 2-1
is 13
, etc. tower_id
: Tower floor icon_id
: Character ID of player icon guild_id
: Guild ID guild_name
: Guild Name guild_join_time
: Time of joining guild (1 time in milliseconds) guild_position
: Position in guild. 1 = Master, 2 = Chief, 3 = Member prev_legend_league_class
: Previous Legend League Class. 1 = Chevalier, 2 = Paladin, 3 = Grand Cross, 4 = Royal Rank, 5 = Legend Rank, 6 = World Ruler. /[world_id]/guild_ranking/latest
Guild rankings for a world. Includes BP, Guild Level, and Guild Stock rankings.
"data": { "world_id": 1001, "rankings": { "bp": [ { "id": 987654321001, "name": "Guild", "bp": 100000000 }, ... ], "level": [ { "id": 987654321001, "name": "Guild", "level": 20 }, ... ], "stock": [ { "id": 987654321001, "name": "Guild", "stock": 14400 }, ... ] }, "guild_info": { "987654321001": { "id": 987654321001, "name": "Guild", "bp": 10000000000, "level": 20, "stock": 14400, "exp": 1405123, "num_members": 34, "leader_id": 123456789001, "leader_name": "Player", "policy": 0, "description": "Just another guild", "free_join": false, "bp_requirement": 999999999 }, ... } }
world_id
: Four-digit world ID rankings
: ranking data bp
: Ranking data by BP in descending order level
: Ranking data by Guild Level in descending order stock
: Ranking data by Guild Stock in descending order guild_info
: additional guild info for guilds that appeared in rankings
. Dictionary with guild id as key. id
: Guild ID. Last three digits are world number. name
: Guild Name bp
: Guild BP level
: Guild Level stock
: Guild Stock exp
: Guild Experience num_members
: Number of members leader_id
: Guild Master's Player ID leader_name
: Guild Master's Name policy
: [[deprecated]] Guild Activity Policy (legacy, before 2.18.0). Always 0. description
: Guild Description free_join
: Whether a player can join without approval bp_requirement
: BP Requirement /[world_id]/temple/latest
Temple data for a world.
"data": { "world_id": 1001, "quest_ids": [208001, 308003, 408006, 408009] }
world_id
: Four-digit world ID quest_ids
: Array of IDs for the current raids in temple RLLLSS
where R
is the reward (1 = EXP Orb, 2 = Upgrade Water, 3 = Upgrade Panacea, 4 = Kindling Orb, 5 = Rune Ticket), LLL
is the difficulty level, and SS
is the number of stars.BBLLLDDSSB
where BBB
is the LocalRaidBannerId, LLL
is the difficulty level, DD
is the number of days since start of event, and SS
is the number of stars./[world_id]/arena/latest
Battle League data for a world.
/[world_id]/localgvg/latest
Guild Battle data for a world.
"data": { "world_id": 1001, "castles": [ { "CastleId": 1, "GuildId": 123456789001, "AttackerGuildId": 0, "AttackPartyCount": 0, "DefensePartyCount": 120, "GvgCastleState": 0, "UtcFallenTimeStamp": 0 }, ... ], "guilds": { "123456789001": "Guild", ... } }
world_id
: Four-digit world ID castles
: castle data CastleId
: Castle ID GuildId
: ID of guild that held this castle at the start of the day AttackerGuildId
: ID of guild that declared on this castle today AttackPartyCount
: Number of parties attacking this castle DefenseGuildId
: Number of parties defending this castle GvgCastleState
: State of battle at this castle. 0 = none, 1 = declared/in battle, 2 = fallen, 3 = counterattack, 4 = counterattack successful UtcFallenTimeStamp
: milliseconds since 1 January 1970, 00:00:00 server time guilds
: names of guilds that may appear in guild war today. Mapping from guild id to guild name. /[world_id]/weekly/arena/latest
Weekly Topics - Battle League data for a world.
"data": { "world_id": 1001, "ranker_usage": [ { "CharacterId"": 60, "UsageRate": 10.001107 }, ... ], "total_usage": [ { "CharacterId"": 60, "UsageRate": 10.001107 }, ... ], "win_continue_count": { { "PlayerId"": 123456789001, "PlayerName": "Player", "WinContinueCount": 10 }, ... } }
world_id
: Four-digit world ID ranker_usage
: Usage statistics in Battle League for players in top 30 CharacterId
: Character ID UsageRate
: Utilization percentage total_usage
: Usage statistics in Battle League for all players CharacterId
: Character ID UsageRate
: Utilization percentage win_continue_count
: Top consecutive wins in Battle League PlayerId
: Player ID PlayerName
: Player Name WinContinueCount
: Number of consecutive wins /[world_id]/weekly/boss/latest
Weekly Topics - Main Quest data for a world.
"data": { "world_id": 1001, "frontline_min_chapter_id": 30, "frontline_usage": [ { "CharacterId"": 60, "UsageRate": 10.001107 }, ... ], "total_usage": [ { "CharacterId"": 60, "UsageRate": 10.001107 }, ... ], "chapter_counts": { "31": 1, ... } }
world_id
: Four-digit world ID frontline_min_chapter_id
: Chapter ID used for frontline_usage
frontline_usage
: Usage statistics in Main Quest for players in chapter frontline_min_chapter_id
and up CharacterId
: Character ID UsageRate
: Utilization percentage total_usage
: Usage statistics in Main Quest for all players CharacterId
: Character ID UsageRate
: Utilization percentage chapter_counts
: Count of players in certain chapters /[world_id]/weekly/chara/latest
Weekly Topics - Character Ranking data for a world.
"data": { "world_id": 1001, "blue": [ { "CharacterId": 1, "CharacterDetailInfo": { ... }, "PlayerId": 123456789001 }, ... ], "red": [ ... ], "green": [ ... ], "yellow": [ ... ], "light": [ ... ], "dark": [ ... ], "players": { "123456789001": { ... }, ... } }
world_id
: Four-digit world ID blue
: Ranking for Azure characters CharacterId
: Character ID CharacterDetailInfo
: Stats and equipment of the character PlayerId
: Character's player's ID red
: Ranking for Crimson characters green
: Ranking for Emerald characters yellow
: Ranking for Amber characters light
: Ranking for Radiant characters dark
: Ranking for Chaos characters players
: Mapping of player ID to player info /wg/[wgroup_id]/legend/latest
Legend League data for a world group.
/wg/[wgroup_id]/globalgvg/[class]/[block]/latest
Grand War data for a block. [class]
should be one of 1 = Elite Class, 2 = Expert Class, or 3 = Grand Master. [block]
should be one of 0 = A, 1 = B, 2 = C, 3 = D.
"data": { "matching_number": 1102, "castles": [ { "CastleId": 1, "GuildId": 123456789001, "AttackerGuildId": 0, "AttackPartyCount": 0, "DefensePartyCount": 120, "GvgCastleState": 0, "UtcFallenTimeStamp": 0 }, ... ], "guilds": { "123456789001": "Guild", ... } }
matching_number
: Matching Number for this block. General format is GGC0B
where GG
is the world group ID, C
is the class, and B
is the block. castles
: castle data CastleId
: Castle ID GuildId
: ID of guild that held this castle at the start of the day AttackerGuildId
: ID of guild that declared on this castle today AttackPartyCount
: Number of parties attacking this castle DefenseGuildId
: Number of parties defending this castle GvgCastleState
: State of battle at this castle. 0 = none, 1 = declared/in battle, 2 = fallen, 3 = counterattack, 4 = counterattack successful UtcFallenTimeStamp
: milliseconds since 1 January 1970, 00:00:00 server time guilds
: names of guilds that may appear in guild war today. Mapping from guild id to guild name. /wg/[wgroup_id]/weekly/legend/latest
Weekly Topics - Legend League data for a world.
"data": { "group_id": 1, "ranker_usage": [ { "CharacterId"": 60, "UsageRate": 10.001107 }, ... ], "total_usage": [ { "CharacterId"": 60, "UsageRate": 10.001107 }, ... ], "win_continue_count": { { "PlayerId"": 123456789001, "PlayerName": "Player", "WinContinueCount": 10 }, ... } }
group_id
: World group ID ranker_usage
: Usage statistics in Legend League for players in top 30 CharacterId
: Character ID UsageRate
: Utilization percentage total_usage
: Usage statistics in Legend League for all players CharacterId
: Character ID UsageRate
: Utilization percentage win_continue_count
: Top consecutive wins in Legend League PlayerId
: Player ID PlayerName
: Player Name WinContinueCount
: Number of consecutive wins /[server]/destiny_log/latest
Invocation of Chance logs for a server.
"data": [ { "Name": "MaintenanceMori", "UserItem": { "ItemCount": 1, "ItemId": 41, "ItemType": 6, } }, ... ]
Name
: Player name UserItem
: Information for the item rolled ItemCount
: Number of copies. This is either 1
(character) or 30000
(diamonds). ItemId
: Item ID. This is either the character ID or 1
(diamonds). ItemType
: Item type. This is either 6
(character) or 1
(diamonds). /[server]/stars_guidance_log/latest
Invocation of The Stars' Guidance logs for a server.
"data": [ { "Name": "MaintenanceMori", "UserItem": { "ItemCount": 1, "ItemId": 41, "ItemType": 6, } }, ... ]
Name
: Player name UserItem
: Information for the item rolled ItemCount
: Number of copies. This is either 1
(character) or 30000
(diamonds). ItemId
: Item ID. This is either the character ID or 1
(diamonds). ItemType
: Item type. This is either 6
(character) or 1
(diamonds). /gvg
Realtime Guild Battle and Grand War data.
This endpoint uses WebSockets, obeying the protocol described below. All frames are binary frames, and all integers follow little-endian encoding.
A stream ID is a 4-byte integer containing:
This stream ID should be encoded in little-endian. For example, the stream ID 0xbc080015 corresponds to Guild Battle Castle 21 on World 6017. This is sent/received over the network as the 4-byte sequence 0x15 0x00 0x08 0xbc.
After connecting to the endpoint, clients should send one or more stream IDs indicating which castles it wishes to listen for updates on. Using Castle ID = 0 here will subscribe the client to all changes in the corresponding instance of Guild Battle/Grand War.
A client may send the stream ID of a stream it is currently listening on to unsubscribe itself from that stream.
For Grand War, the World ID used when subscribing/unsubscribing should be 0. Guild Information Messages will set the world ID corresponding to the world of the guild.
The server will send two types of messages: guild information messages and castle status messages. These messages can be distinguished by the Castle ID field of the included stream IDs -- guild information messages always have Castle ID = 0.
Note that all guild IDs sent contain only the first 9 digits of the full guild ID. The last 3 digits are always equal to the last three digits of the world ID.
A single WebSocket message may contain one or more of the two types of messages.
Structures:
struct StreamId { uint32_t castle_id: 5; uint32_t block: 3; uint32_t group: 8; uint32_t gvg_class: 3; uint32_t world_id: 13; }; struct GuildInformation { struct StreamId stream_id; uint32_t guild_id; uint8_t guild_name_len; char guild_name[]; }; struct CastleStatus { struct StreamId stream_id; uint32_t guild_id; uint32_t attacker_guild_id; uint32_t utc_fallen_timestamp; uint16_t defense_count; uint16_t attack_count; uint8_t state; uint8_t reserved[1]; uint16_t ko_count; };