Atlas API: api/v1/castle info?cont ids=list

=Description= Get detailed castle data.

=Usage= 1. Get the castle id from Atlas API: api/v1/atlas/castles/metadata/macro?realm name=Celestial Haven&k id=1

2. Build the cont_ids list. k_id=1 (as shown in url parameters from step 1.). region_id starts with the letter 'A'. cont_idx starts counting from 0 to N-1 where N=(number of castles on that tile).

Example
Here's an example of a request for two castles worth of data. https://api-dot-pgdragonsong.appspot.com/api/v1/castle_info?cont_ids=[{"cont_idx":"0","k_id":"1","region_id":"A810"},{"cont_idx":"0","k_id":"1","region_id":"A882"}]

=Output=

=Notes=

Cooldown Duration Function
def getCooldownDuration(region_level): if region_level == 5: return 12*60*60 if region_level == 4: return 9*60*60 if region_level == 3: return 6*60*60 if region_level == 2: return 3*60*60 return 0

Shield Amount Function
def getShieldAmount(fort_level): if fort_level > 0: return (50000 + (10000*fort_level)) return 50000

Shield State
troops till bubble = getShieldAmount(['infra']['fort']['level']) - ['infra']['fort']['shield_ships_lost'] bubble time left = (['infra']['fort']['shield_time_ts'] - now) < 0 ? 0 : (['infra']['fort']['shield_time_ts'] - now) cooldown time left = (now - ['infra']['fort']['shield_time_ts']) > getCooldownDuration(['level']+1) ? 0 : getCooldownDuration(['level']+1) - (now - ['infra']['fort']['shield_time_ts'])