API Documentation - sh4rkman/SquadCalc GitHub Wiki
SquadCalc collects and aggregates data from players through the official website and by placing markers. This data is gathered anonymously to build a database of "common places" where players typically position their weapons and where they frequently shoot. This information enables the generation of usage statistics or for the creation of heatmaps.
This API also expose some game Data extracted from the SDK as layers and factions.
To get access to the API for your project, please contact me directly on Github, or Discord.
A "beta" API is available for testing needs, without any access restriction at https://beta.squadcalc.app/api
The Beta API is not to be used for production because of it's restriction :
- Only a few maps have layers available
- Sessions are restricted to 2 maximum users
- Heatmaps are either incomplete or full of fake data
Retrieve if API is live or not.
-
Method:
GET
-
URL:
https://beta.squadcalc.app/api/health
200
: API is alive
4xx/5xx
: API is dead/forbidden
Retrieve weapon placement data for a specific map. If a weapon is provided, the data is filtered by weapon. If no weapon is specified, data for all weapons on the specified map is returned.
-
Method:
GET
-
URL:
https://beta.squadcalc.app/api/get/weapons
-
Query Parameters:
-
map
(required): The name of the map (case-insensitive). -
weapon
(optional): The name of the weapon (case-insensitive). If omitted, data for all weapons is returned.
-
Query Parameters Example:
GET https://beta.squadcalc.app/api/get/weapons?map=AlBasrah&weapon=Mortar
GET https://beta.squadcalc.app/api/get/weapons?map=Gorodok
Return weapons lat;lng position on a -255:255 units square plan, with a standard weight.
[weapon.lat, weapon.lng, weight]
Response example:
[
[-45.23, 120.98, 0.35],
[-76.12, 89.45, 0.35],
[-30.21, 220.10, 0.35]
]
Retrieve target placement data for a specific map. If a weapon is provided, the data is filtered by weapon. If no weapon is specified, data for all targets on the specified map is returned.
-
Method:
GET
-
URL:
https://beta.squadcalc.app/api/get/targets
-
Query Parameters:
-
map
(required): The name of the map (case-insensitive). -
weapon
(optional): The name of the weapon used for placing the target (case-insensitive). If omitted, data for all weapons is returned.
-
Query Parameters Example:
GET https://beta.squadcalc.app/api/get/targets?map=AlBasrah&weapon=Mortar
GET https://beta.squadcalc.app/api/get/targets?map=Gorodok
Return targets lat;lng position on a -255:255 units square plan, with a standart weight.
[target.lat, target.lng, weight]
Response example:
[
[-45.23, 120.98, 0.35],
[-76.12, 89.45, 0.35],
[-30.21, 220.10, 0.35]
]
Retrieve a list of available RAAS/AAS/Invasion/Destruction layers for a given map.
-
Method:
GET
-
URL:
https://beta.squadcalc.app/api/get/layers&map=MAP_NAME
-
Query Parameters:
-
map
(required): The name of the map (case-insensitive).
-
Query Parameters Example:
GET https://beta.squadcalc.app/api/get/layers?map=AlBasrah
[
{
"rawName": "AlBasrah_RAAS_v1",
"shortName": "RAAS v1"
},
{
"rawName": "AlBasrah_Invasion_v1",
"shortName": "Invasion v1"
},
{
"rawName": "AlBasrah_Invasion_v2",
"shortName": "Invasion v2"
},
{
"rawName": "AlBasrah_AAS_v1",
"shortName": "AAS v1"
}
]
Retrieve a layer assets, capture points, factions, units, boundaries, borders, and other data for a given layer name.
-
Method:
GET
-
URL:
https://beta.squadcalc.app/api/get/layer&name=LAYER_NAME
-
Query Parameters:
-
layer
(required): The name of a layer returned by/api/get/layers
-
Query Parameters Example:
GET https://beta.squadcalc.app/api/get/layer?name=AlBasrah_RAAS_v1
{
"assets": [
"deployables": [],
"helipads": [],
],
"border": [], // Playable Aera
"capturePoints": [
"clusters": [],
"destructionObject": [], // Destruction
"hexs": [], // Territory Control
"lanes": [], // RAAS
"points": [], // AAS
"type": "RAASLane Graph",
],
"factions" : [
"team1factions": [],
"team2factions": [],
],
"gamemode": "RAAS",
"layerVersion": "v1",
"mapAssets" : [
"protectionZones": [],
],
"mapId": "Gorodok",
"mapName": "Gorodok",
"mapTextureCorners": [],
"objectives": [],
"rawName": "Gorodok_AAS_v1",
"teamConfigs" : [
"factions": [],
"team1": [],
"team2": [],
],
}
When calling the API, the following names are to be used to fill queries:
AlBasrah
, Anvil
, Belaya
, BlackCoast
, Chora
, Fallujah
, FoolsRoad
,
GooseBay
, Gorodok
, Jensen
, Harju
, Kamdesh
, Kohat
, Kokan
,
Lashkar
, Logar
, Manicouagan
, Mestia
, Mutaha
, Narva
, Narva_f
,
Pacific
, Sanxian
, Skorpo
, Sumari
, Tallil
, Yehorivka
Mortar
, UB-32
, HellCannon
, Tech.Mortar
, Tech.UB-32
,
BM-21Grad
, M1064M121
, Mk19