{"docs":{"openapi":"3.1.0","info":{"title":"B2 Calculator Api","version":"1.0.9"},"servers":[{"url":"https:\/\/b2.wtf"}],"paths":{"\/api\/{group}\/{version}":{"get":{"tags":["Documentation"],"summary":"Fetch OpenAPI JSON docs for any API group","operationId":"getApiGroupDocs","responses":{"200":{"$ref":"#\/components\/responses\/responseDocs"}},"security":[]},"post":{"tags":["Documentation"],"summary":"Fetch OpenAPI JSON docs via POST","operationId":"postApiGroupDocs","responses":{"200":{"$ref":"#\/components\/responses\/responseDocs"}},"security":[]},"parameters":[{"name":"group","in":"path","description":"API group prefix (e.g. calculator, gsc)","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"API version for a specific group (e.g. v1, v2)","required":true,"schema":{"type":"string"}}]},"\/api\/calculator\/v1\/round_time":{"post":{"summary":"Get the best possible round times for specified parameters","description":"Endpoint generating data about fastest possible time to complete a round as well as various statistics about that round","operationId":"e8f30d2681f00a69375e8214c6368374","requestBody":{"$ref":"#\/components\/requestBodies\/requestCalculatorRound"},"responses":{"200":{"$ref":"#\/components\/responses\/responseCalculatorRoundTime"},"429":{"$ref":"#\/components\/responses\/responseRateLimit"}}}},"\/api\/calculator\/v1\/perfect_time":{"post":{"summary":"Get perfect times up to a specific round.","description":"Endpoint generating data about perfect time to a round. Data about a round shows stats up to that round","operationId":"b69b537a83f8442d9054ede3eb82099b","requestBody":{"$ref":"#\/components\/requestBodies\/requestCalculatorRound"},"responses":{"200":{"$ref":"#\/components\/responses\/responseCalculatorPerfectTime"},"429":{"$ref":"#\/components\/responses\/responseRateLimit"}}}}},"components":{"schemas":{"propertyCalculatorAppliedSpawnOffeset":{"description":"Defines if offset was incremented on that round.","type":"boolean"},"propertyCalculatorConfig":{"description":"Object containing configuration for the calculation. For input, contains customized option for the calculation. On the output, returns configured option and defaults if not otherwise configured.","properties":{"range":{"description":"Used option for 'range' config key","type":"boolean","default":false},"time_format":{"description":"Used option for 'time_format' config key","type":"string","example":"hh:mm:ss.ms"},"special_rounds":{"description":"Used option for 'special_rounds' config key","type":"array","items":{"type":"integer"},"example":[5,9,13,17,21,25,29]},"moon_teleports":{"description":"Used option for 'moon_teleports' config key","type":"array","items":{"type":"integer"},"example":[1,5,10,20]}},"type":"object"},"propertyCalculatorDuration":{"description":"Duration of the round in MS.","type":"integer","minimum":0,"example":10000},"propertyCalculatorEndpoint":{"type":"string","example":"round_time"},"propertyCalculatorEnemyType":{"description":"Type of enemies for the round.","type":"string","enum":["Zombie","Hellhound","Astronaut"],"example":"Zombie"},"propertyCalculatorFormattedTime":{"description":"Round duration with requested formatting, or equal to duration key if no formatting was requested","type":["integer","string"],"example":10000},"propertyCalculatorFormattedTimePerfect":{"description":"Game duration with requested formatting, or equal to duration key if no formatting was requested","type":["integer","string"],"example":10000},"propertyCalculatorGame":{"description":"Game code relevant for the scope of this object. For output it specifies the game used for calculation represented by that specific object, for input it takes the game used for calculations.","type":"string","enum":["t4","t5","t6","remix1"],"example":"t6"},"propertyCalculatorHealth":{"description":"Max health of the zombie in the round.","type":"integer","example":150},"propertyCalculatorMap":{"description":"Map code relevant for the scope of this object. For output it specifies the map used for calculation represented by that specific object, for input it takes the map used for calculations. ATTENTION, this api supports old map codes (you will tell them by `zm_` prefix). They are now deprecated and will not be supported in next major API version","type":"string","enum":["prototype","asylum","sumpf","factory","theater","moon","transit","nuked","buried","zm_prototype","zm_asylum","zm_sumpf","zm_factory","zm_theater","zm_moon","zm_transit","zm_nuked","zm_buried"],"example":"transit"},"propertyCalculatorNetworkFrame":{"description":"Current network frame used for calculations in MS","type":"integer","example":100},"propertyCalculatorPerfectData":{"type":"object","example":{"2":{"round":2,"players":1,"map":"moon","game":"t5","duration":22100,"health":150,"zombie_count":6,"enemy_type":"Zombie","spawn_rate_actual":"2.00","spawn_rate_raw":"2.0000000000000000","spawn_rate_offset":{"value":"1.90","zombie_offset":0},"applied_spawn_offset":true,"network_frame":100,"use_network_frame_in_spawnrate":true,"formatted_time":22100,"total_zombie_count":6,"perfect_time":59300,"formatted_time_perfect":59300}},"additionalProperties":{"properties":{"round":{"$ref":"#\/components\/schemas\/propertyCalculatorRound"},"players":{"$ref":"#\/components\/schemas\/propertyCalculatorPlayers"},"map":{"$ref":"#\/components\/schemas\/propertyCalculatorMap"},"game":{"$ref":"#\/components\/schemas\/propertyCalculatorGame"},"duration":{"$ref":"#\/components\/schemas\/propertyCalculatorDuration"},"health":{"$ref":"#\/components\/schemas\/propertyCalculatorHealth"},"zombie_count":{"$ref":"#\/components\/schemas\/propertyCalculatorZombieCount"},"enemy_type":{"$ref":"#\/components\/schemas\/propertyCalculatorEnemyType"},"spawn_rate_actual":{"$ref":"#\/components\/schemas\/propertyCalculatorSpawnRateActual"},"spawn_rate_raw":{"$ref":"#\/components\/schemas\/propertyCalculatorSpawnRateRaw"},"spawn_rate_offset":{"$ref":"#\/components\/schemas\/propertyCalculatorSpawnRateOffset"},"applied_spawn_offset":{"$ref":"#\/components\/schemas\/propertyCalculatorAppliedSpawnOffeset"},"network_frame":{"$ref":"#\/components\/schemas\/propertyCalculatorNetworkFrame"},"use_network_frame_in_spawnrate":{"$ref":"#\/components\/schemas\/propertyCalculatorUseNetworkFrameInSpawnrate"},"formatted_time":{"$ref":"#\/components\/schemas\/propertyCalculatorFormattedTime"},"total_zombie_count":{"$ref":"#\/components\/schemas\/propertyCalculatorTotalZombieCount"},"perfect_time":{"$ref":"#\/components\/schemas\/propertyCalculatorPerfectTime"},"formatted_time_perfect":{"$ref":"#\/components\/schemas\/propertyCalculatorFormattedTimePerfect"}},"type":"object"}},"propertyCalculatorPerfectTime":{"description":"Duration of the game up until round of the object.","type":"integer","minimum":0,"example":10000},"propertyCalculatorPlayers":{"description":"Player count relevant for the scope of this object. For output it specifies the amount of players used for calculation represented by that specific object, for input it defines the amount of players for the calculation","type":"integer","maximum":8,"minimum":1,"example":1},"propertyCalculatorRound":{"description":"Round number relevant for the scope of this object. For output it specifies the round the object is describing, for input it defines round number for the calculation","type":"integer","maximum":65535,"minimum":1,"example":1},"propertyCalculatorRoundData":{"type":"object","example":{"1":{"round":1,"players":1,"map":"moon","game":"t5","duration":9600,"health":150,"zombie_count":6,"enemy_type":"Zombie","spawn_rate_actual":"2.00","spawn_rate_raw":"2.0000000000000000","spawn_rate_offset":{"value":"1.90","zombie_offset":0},"applied_spawn_offset":true,"network_frame":100,"use_network_frame_in_spawnrate":true,"formatted_time":9600}},"additionalProperties":{"properties":{"round":{"$ref":"#\/components\/schemas\/propertyCalculatorRound"},"players":{"$ref":"#\/components\/schemas\/propertyCalculatorPlayers"},"map":{"$ref":"#\/components\/schemas\/propertyCalculatorMap"},"game":{"$ref":"#\/components\/schemas\/propertyCalculatorGame"},"duration":{"$ref":"#\/components\/schemas\/propertyCalculatorDuration"},"health":{"$ref":"#\/components\/schemas\/propertyCalculatorHealth"},"zombie_count":{"$ref":"#\/components\/schemas\/propertyCalculatorZombieCount"},"enemy_type":{"$ref":"#\/components\/schemas\/propertyCalculatorEnemyType"},"spawn_rate_actual":{"$ref":"#\/components\/schemas\/propertyCalculatorSpawnRateActual"},"spawn_rate_raw":{"$ref":"#\/components\/schemas\/propertyCalculatorSpawnRateRaw"},"spawn_rate_offset":{"$ref":"#\/components\/schemas\/propertyCalculatorSpawnRateOffset"},"applied_spawn_offset":{"$ref":"#\/components\/schemas\/propertyCalculatorAppliedSpawnOffeset"},"network_frame":{"$ref":"#\/components\/schemas\/propertyCalculatorNetworkFrame"},"use_network_frame_in_spawnrate":{"$ref":"#\/components\/schemas\/propertyCalculatorUseNetworkFrameInSpawnrate"},"formatted_time":{"$ref":"#\/components\/schemas\/propertyCalculatorFormattedTime"}},"type":"object"}},"propertyCalculatorSpawnRateActual":{"description":"Spawn rate during the round rounded with GSC logic.","type":"string","pattern":"^\\d\\.[\\d]{2}$","example":"2.00"},"propertyCalculatorSpawnRateOffset":{"description":"Info about applied spawnrate offsets.","properties":{"value":{"description":"Spawnrate value with applied offset. If false, no offset is applied.","type":["boolean","string"],"readOnly":true,"example":"1.90"},"zombie_offset":{"description":"Enemy count with applied offset. If false, no offset is applied.","type":["boolean","integer"],"readOnly":true,"example":0}},"type":"object"},"propertyCalculatorSpawnRateRaw":{"description":"Raw spawn rate during the round.","type":"string","pattern":"^\\d\\.[\\d]+$","example":"1.8999999761581421"},"propertyCalculatorTotalZombieCount":{"description":"Total enemy count from the beginning of the game up until round of this object.","type":"integer","minimum":1,"example":6},"propertyCalculatorUseNetworkFrameInSpawnrate":{"description":"Whether network frame is included in overall round time while calculating respawn rate","type":"boolean"},"propertyCalculatorVersion":{"type":"string","example":"1.0.8"},"propertyCalculatorZombieCount":{"description":"Enemy count for the round.","type":"integer","minimum":1,"example":6},"propertyUUIDv4":{"description":"UUID identifier version 4.","type":"string","example":"dad5266d-564c-498a-8ef2-2fc6e65baaa2"}},"responses":{"responseCalculatorPerfectTime":{"description":"Details about round(s)","content":{"application\/json":{"schema":{"properties":{"round_data":{"$ref":"#\/components\/schemas\/propertyCalculatorPerfectData"},"config":{"$ref":"#\/components\/schemas\/propertyCalculatorConfig"},"endpoint":{"$ref":"#\/components\/schemas\/propertyCalculatorEndpoint"},"version":{"$ref":"#\/components\/schemas\/propertyCalculatorVersion"}},"type":"object"}}}},"responseCalculatorRoundTime":{"description":"Details about round(s)","content":{"application\/json":{"schema":{"properties":{"round_data":{"$ref":"#\/components\/schemas\/propertyCalculatorRoundData"},"config":{"$ref":"#\/components\/schemas\/propertyCalculatorConfig"},"endpoint":{"$ref":"#\/components\/schemas\/propertyCalculatorEndpoint"},"version":{"$ref":"#\/components\/schemas\/propertyCalculatorVersion"}},"type":"object"}}}},"responseRateLimit":{"description":"Returned when unauthenticated caller exceedes rate limit for open endpoint"},"responseDocs":{"description":"OpenApi documentation for a component following OA 3.1.0 standards","content":{"application\/json":{"example":"{}"}}}},"requestBodies":{"requestCalculatorRound":{"required":true,"content":{"application\/json":{"schema":{"required":["round","players","map","game","config"],"properties":{"round":{"$ref":"#\/components\/schemas\/propertyCalculatorRound"},"players":{"$ref":"#\/components\/schemas\/propertyCalculatorPlayers"},"map":{"$ref":"#\/components\/schemas\/propertyCalculatorMap"},"game":{"$ref":"#\/components\/schemas\/propertyCalculatorGame"},"config":{"$ref":"#\/components\/schemas\/propertyCalculatorConfig"}},"type":"object"}}}}},"securitySchemes":{"keyAuth":{"type":"apiKey","description":"SHA-512'd API key bound to a specific permission","name":"Authorization","in":"header"}}},"security":[[],{"keyAuth":[]}],"tags":[{"name":"Documentation","description":"Documentation"}]}}