REST API

The spider tanks REST API gives you access to player statistics, data of the tanks from in-game and analytics. All this data can be requested via some simple HTTP GET requests. The base url is https://dev.gamedia.nl/stapi and it is used for all REST API requests.

## Player

### GET player/id

This request is used to get the data of one specific player.

**Parameters:**

* id string - The player’s id that is also used to connect with friends in-game.

**Returns:** Json object with the values as shown below.

```
{
 "id": "PlayerId",
 "name": "PlayerName",
 "wins": 0,
 "losses": 0,
 "kills": 0,
 "deaths": 0,
 "damage": 0,
 "repairs": 0,
 "timeWithFlag": 0,
 "chickensCollected": 0,
 "eggsSecured": 0,
 "currentRank": "Rank",
 "highestRank": "Rank",
 "favoriteBody": "BodyId",
 "favoriteWeapon": "WeaponId",
 "favoriteAbility": "AbilityId"
}

```

### GET players

This request is used to get the data of multiple players.

**Parameters:**

* body json - requires a json array of player ids as strings

```
[
 "PlayerId",
 ...
]

```
**Returns:** Json array with the values as shown below.

```
[
 {
 "id": "PlayerId",
 "name": "PlayerName",
 "wins": 0,
 "losses": 0,
 "kills": 0,
 "deaths": 0,
 "damage": 0,
 "repairs": 0,
 "timeWithFlag": 0,
 "chickensCollected": 0,
 "eggsSecured": 0,
 "currentRank": "Rank",
 "highestRank": "Rank",
 "favoriteBody": "BodyId",
 "favoriteWeapon": "WeaponId",
 "favoriteAbility": "AbilityId"
 },
 ...
]

```

## Tank

All tank parts that are retrieved with a level are returned with the stats of a perfectly upgraded part. In-game you level with random stats and don’t always get perfect upgrades.

### GET tank/weapon/id/level?

This request is used to get the data of one specific tank weapon with a level.

**Parameters:**

* id string - The tank weapon’s id that is the same as the in-game name.
* level int/string (optional) - The level of the tank weapon with a range of 0-30. It is also possible to give the level as a rarity. Just provide a string with one of the rarities: Common, Uncommon, Rare, Epic, Legendary, Ancient. If no level/rarity is provided then the tank weapon is returned with a level of 0.

**Returns:** Json object with a sub selection of the values as shown below. Id and level will always be returned.

```
{
 "id": "WeaponId",
 "level": 0,
 "projectileWeapon": {
 "chargeTime": 1.0,
 "reloadTime": 1.0,
 "windupTime": 1.0,
 "clipSize": 1,
 "rateOfFire": 1,
 "reloadPercentageNotReturning": 1.0,
 "maxSpreadAngle": 360.0,
 "attackModifierChance": 1
 },
 "coneWeapon": {
 "reloadTime": 1,
 "clipSize": 1,
 "lifeStealMultiplier": 1.0,
 "damage": 1,
 "windupTime": 1,
 "lifeGiveMultiplier": 1.0,
 "maxTurnRateWhileShooting": 1.0,
 "range": 1,
 "falloff": {
 "start": 1,
 "end": 1
 },
 "rateOfFire": 1,
 "maxSpreadAngle": 360
 },
 "damagingProjectile": {
 "damage": 1,
 "speed": 1,
 "range": 1,
 "gravity": 0,
 "onBounceLifetime": 1.0,
 "bouncedDamageMultiplier": 1,
 "bouncedSpeedMultiplier": 1,
 "damageMultiplierIncreasePerClip": 1.0,
 "scaleMultiplierIncreasePerClip": 1.0
 },
 "chargedProjectile": {
 "damage": 1,
 "speed": 1.0,
 "range": 1,
 "acceleration": -1,
 "returnAccelerationMultiplierDistance": 1.0,
 "returnAccelerationMultiplier": -1,
 "gravity": 0
 },
 "explosiveProjectile": {
 "gravity": 0,
 "damage": 1,
 "repairAmount": 1,
 "acceleration": 1,
 "homingCooldownDuration": 1.0,
 "homingDetectionAngle": 360,
 "homingRange": 1,
 "homingPredictionDistance": 1.0,
 "homingStrength": 1,
 "maxMagnitude": 1,
 "directHitRadius": 1.0,
 "radius": 1.0,
 "lifetime": 1,
 "damageFalloff": {
 "start": 1,
 "end": 1
 },
 "speed": 1
 },
 "damageStatusEffect": {
 "duration": 1.0,
 "damagePerTick": 1,
 "tickRate": 1.0
 },
 "slowStatusEffect": {
 "duration": 1.0,
 "slowEffectMultiplier": 1,
 "slowEffectMultiplierFullyCharged": 1
 },
 "sapStatusEffect": {
 "amount": 1.0,
 "duration": 1.0
 },
 "damageZone": {
 "lifetime": 1,
 "effectRadius": 1,
 "tickRate": 1,
 "slowEffectMultiplier": 1.0,
 "slowDuration": 1.0,
 "damagePerTick": 1
 },
 "repairZone": {
 "lifetime": 1,
 "effectRadius": 1,
 "tickRate": 1,
 "repairingPerTick": 1
 }
}

```

### GET tank/weapons/level

This request is used to get the data of multiple tank weapons with a level.

**Parameters:**

* level int/string - The level of the tank weapon with a range of 0-30. It is also possible to give the level as a rarity. Just provide a string with one of the rarities: Common, Uncommon, Rare, Epic, Legendary, Ancient.
* body json (optional) - a json array of tank weapon ids as strings. If it is left empty, then all tank weapons will be returned with the requested level.

```
[
 "WeaponId",
 ...
]

```
**Returns:** Json array with objects as described in the previous returns section.

```
[
  WeaponData,
  ...
]
```

### GET tank/weapons

This request is used to get data of multiple tank weapons with the possibility to request different levels for each tank weapon.

**Parameters:**

* body json (optional) - a json array of objects containing: a tank weapon id as a string and an optional level. If the level is not provided then it will default to 0. It is also possible to give the level as a rarity. Just provide a string with one of the rarities: Common, Uncommon, Rare, Epic, Legendary, Ancient. If the body is left empty, then all tank weapons will be returned with a level of 0.

```
[
 {
 "id": "WeaponId",
 "level": 0
 },
 {
 "id": "WeaponId",
 "level": "Rarity"
 },
 {
 "id": "WeaponId"
 },
 ...
]

```
**Returns:** Json array with objects as described in the previous returns section.

```
[
  WeaponData,
  ...
]
```

### GET tank/body/id/level?

This request is used to get the data of one specific tank body with a level.

**Parameters:**

* id string - The tank body’s id that is the same as the in-game name.
* level int/string (optional) - The level of the tank body with a range of 0-30. It is also possible to give the level as a rarity. Just provide a string with one of the rarities: Common, Uncommon, Rare, Epic, Legendary, Ancient. If no level/rarity is provided then the tank body is returned with a level of 0.

**Returns:** Json object with the values as shown below.

```
{
 "id": "BodyId",
 "level": 0,
 "health": 1.0,
 "speed": 1.0,
 "chargeSpeed": 1.0
}

```

### GET tank/bodies/level

This request is used to get the data of multiple tank bodies with a level.

**Parameters:**

* level int/string - The level of the tank body with a range of 0-30. It is also possible to give the level as a rarity. Just provide a string with one of the rarities: Common, Uncommon, Rare, Epic, Legendary, Ancient.
* body json (optional) - a json array of tank body ids as strings. If it is left empty, then all bodies will be returned with the requested level.

```
[
 "BodyId",
 ...
]

```
**Returns:** Json array with the values as shown below.

```
[
 {
 "id": "BodyId",
 "level": 0,
 "health": 1.0,
 "speed": 1.0,
 "chargeSpeed": 1.0
 },
 ...
]

```

### GET tank/bodies

This request is used to get data of multiple tank bodies with the possibility to request different levels for each tank body.

**Parameters:**

* body json (optional) - a json array of objects containing: a tank body id as a string and an optional level. If the level is not provided then it will default to 0. It is also possible to give the level as a rarity. Just provide a string with one of the rarities: Common, Uncommon, Rare, Epic, Legendary, Ancient. If the body is left empty, then all tank bodies will be returned with a level of 0.

```
[
 {
 "id": "BodyId",
 "level": 0
 },
 {
 "id": "BodyId",
 "level": "Rarity"
 },
 {
 "id": "BodyId"
 },
 ...
]

```
**Returns:** Json array with the values as shown below.

```
[
 {
 "id": "BodyId",
 "level": 0,
 "health": 1.0,
 "speed": 1.0,
 "chargeSpeed": 1.0
 },
 ...
]

```

### GET tank/ability/id/level?

This request is used to get the data of one specific tank ability with a tank weapon and tank body level.

**Parameters:**

* id string - The tank ability’s id that is the same as the in-game name.
* level int/string (optional) - The level of the tank weapon and tank body with a range of 0-30.

**Returns:** Json object with a sub selection of the values as shown below. The WeaponData object does not contain an id and it is not guaranteed in the object. Id, weaponLevel, bodyLevel and energyCost will always be returned.

```
{
 "energyCost": 1,
 "id": "AbilityId",
 "weaponLevel": 0,
 "bodyLevel": 0,
 "maxTargetDistance": 1.0,
 "reloadTime": 1.0,
 "duration": 1,
 "hitEffectDuration": 1,
 "damageRadius": 1,
 "absorptionFactor": 1.0,
 "reflectionFactor": 1.0,
 "slowMultiplier": 1.0,
 "maxReflectedDamage": 1,
 "hitPoints": 1,
 "clipSize": 1,
 "maxRange": 1,
 "maxTargetDistance": 1,
 "minTargetDistance": 1,
 "fireInterval": 1.0,
 "speedOffset": 1.0,
 "tickRate": 1.0,
 "effectRadius": 1,
 "pushInterval": 1,
 "pushForceCenter": 1,
 "pushForceRim": 1,
 "pushDuration": 1.0,
 "jamDuration": 1,
 "targetingRadius": 1,
 "repairAmountPerTick": 1,
 "delay": 1.0,
 "regainCloakDelay": 1.2,
 "slowTargetAmount": 1.0,
 "movingInPullDirectionForce": 1,
 "basePullForce": 1.0,
 "slowSelfAmount": 1.0,
 "explosionRadius": 1,
 "explosionDamage": 1,
 "lineLength": 1,
 "weaponData": WeaponData
}

```

### GET tank/ability

This request is used to get the data of one specific tank ability with a tank weapon and/or tank body level.

**Parameters:**

* body json - a json object containing: a tank ability id as a string and an optional level for a tank weapon and tank body. If the level is not provided then it will default to 0.

```
{
 "id": "AbilityId",
 "weaponLevel": 0,
 "bodyLevel": 0
}

```
**Returns:** Json object as described in the previous returns section.

### GET tank/abilities/level

This request is used to get the data of multiple tank abilities with a level for the tank weapon and tank body in one request.

**Parameters:**

* level int/string - The level of the tank weapon and tank body with a range of 0-30.
* body json (optional) - a json array of tank ability ids as strings. If it is left empty, then all abilities will be returned with the requested level.

```
[
 "AbilityId",
 ...
]

```
**Returns:** Json array with objects as described in the previous returns section.

```
[
  AbilityData,
  ...
]
```

### GET tank/abilities

This request is used to get data of multiple tank abilities with the possibility to request different levels for each tank ability.

**Parameters:**

* body json (optional) - a json array of objects containing: a tank ability id as a string and an optional level for the tank weapon and/or tank body . If the level is not provided then it will default to 0. If the body is left empty, then all tank abilities will be returned with a level of 0.

```
[
 {
 "id": "AbilityId",
 "weaponLevel": 0,
 "bodyLevel": 0
 },
 {
 "id": "AbilityId",
 "weaponLevel": 0
 },
 {
 "id": "AbilityId",
 "bodyLevel": 0
 },
 {
 "id": "AbilityId"
 },
 ...
]

```
**Returns:** Json array with objects as described in the previous returns section.

```
[
  AbilityData,
  ...
]
```