The Project

REST API

Obtaining an Access Token using OAuth 2.0 Client Credentials Flow

OAuth 2.0 is a popular protocol used for securing API access. The Client Credentials Flow is one of the grant types in OAuth 2.0 that allows a client (typically a server or a trusted application) to obtain an access token directly from the authorization server without involving a user. This access token can then be used to access protected resources on the API. In this guide, we’ll walk you through the steps to obtain an access token using the Client Credentials Flow, with JSON as the communication format.

Prerequisites

Before you begin, make sure you have the following prerequisites in place:

  • Client Credentials: You should have the client ID and client secret provided by the authorization server. You can obtain this by creating a client via the identity site.

Steps to Obtain an Access Token

Follow these steps to obtain an access token using the Client Credentials Flow:

1. Construct the Token Request

Compose a POST request to the authorization server’s token endpoint (https://identity.tarkov-database.com/v1/oauth/token). Include the following parameters in the request body as a JSON object:

  • grant_type: Set this to “client_credentials” to specify the Client Credentials Flow.
  • client_id: Your client ID.
  • client_secret: Your client secret.
  • scope: Define the scope of access required.

Here is an example request:

POST https://identity.tarkov-database.com/v1/oauth/token HTTP/1.1
Content-Type: application/json

{
    "client_id": "<CLIENT-ID>",
    "client_secret": "<CLIENT-SECRET>",
    "grant_type": "client_credentials",
}

2. Send the Token Request

Send the POST request to the authorization server’s token endpoint (https://identity.tarkov-database.com/v1/oauth/token). You can use your preferred HTTP client library or tool (e.g., cURL, Postman) to make the request.

3. Receive the Access Token

Upon successful authentication and authorization, the authorization server will respond with an access token in the JSON format. The response typically includes:

  • access_token: The access token that you can use to access the protected resources.
  • token_type: The type of the token (usually “Bearer”).
  • expires_in: The expiration time of the token (in seconds).
  • scope: The scope of access granted.

Here is an example response:

{
    "access_token": "<ACCESS-TOKEN>",
    "token_type": "Bearer",
    "expires_in": 3600,
}

4. Use the Access Token

Now that you have obtained an access token, you can include it in the Authorization header of your API requests as follows:

GET /api/resource HTTP/1.1
Host: <SERVICE>.tarkov-database.com
Authorization: Bearer <ACCESS-TOKEN>

Conclusion

That’s it! You have successfully obtained an access token using the OAuth 2.0 Client Credentials Flow. Remember to handle the token securely and renew it as needed, as access tokens typically have a limited lifespan.

Happy coding!

Items

Common

NameTypeDescription
_idstringThe ID of the item
namestringThe name of the item
shortNamestringThe short name of the item
descriptionstringThe description of the item
priceintThe base price in rubles of the item
weightfloatThe weight of the item
maxStackintThe maximum stack size of the item
raritystringThe rarity of the item
gridobjectThe grid properties of the item
_modifiedintThe modified date as Unix timestamp
_kindstringThe entity type of the item

Grid

NameTypeDescription
colorobjectThe grid background color in RGBA
heightintThe grid height of the item
widthintThe grid width of the item

Color

NameTypeDescription
ruintRed channel
guintGreen channel
buintBlue channel
auintAlpha channel

Example

{
  "_id": "590c392f86f77444754deb29",
  "name": "SSD drive",
  "shortName": "SSD",
  "description": "Solid state drive. Used to store data, with enhanced read and write performance.",
  "price": 250000,
  "weight": 0.4,
  "maxStack": 1,
  "rarity": "rare",
  "grid": {
    "color": {
      "r": 28,
      "g": 65,
      "b": 86,
      "a": 255
    },
    "height": 1,
    "width": 1
  },
  "_modified": 1571536468,
  "_kind": "common"
}

Ammunition

NameTypeDescription
caliberstringThe caliber of the ammunition
typestringThe type of the ammunition
tracerboolIndicates if it’s tracer ammunition
tracerColorstringThe tracer color
subsonicboolIndicates if it’s subsonic ammo
velocityfloatVelocity of the projectile(s) in meters per second
ballisticCoeffloatThe ballistic coeficient of the ammo
damagefloatThe flesh damage of the ammo
penetrationfloatThe penetration power of the ammo
armorDamagefloatThe damage done to an armor
fragmentationobjectThe fragmentation properties of the ammo
effectsobjectVarious effects of the ammo
pelletsintDEPRCATED The pellet count of the ammo if it’s buckshot
projectilesintThe projectile count, relevant to e.g. buckshot or flechette rounds
weaponModifierobjectThe fragmentation properties of the ammo

Fragmentation

NameTypeDescription
chancefloatThe penetration chance of the ammunition
minintThe minimal fragment count
maxintIndicates if it’s tracer ammunition

Effects

NameTypeDescription
lightBleedingChancefloatPercentage value increases or decreases the chance of light bleeding
heavyBleedingChancefloatPercentage value increases or decreases the chance of heavy bleeding

Weapon Modifier

NameTypeDescription
accuracyfloatModifier for weapon accuracy (percent)
recoilfloatModifier for weapon recoil (percent)

Example

{
  "_id": "56d59d3ad2720bdb418b4577",
  "name": "9x19 mm Pst gzh",
  "shortName": "Pst gzh",
  "description": "9x19 mm Pst gzh round. Steel core bullet. Developed by TSNIITOCHMASH in the early 90s. Bullet weight — 5,4 g, muzzle velocity — 445—470 m/s. It outperforms the commercially available 9×19 mm Parabellum ordnance and corresponds to the more powerful 9×19 mm NATO army rounds (9×19 +P). The bullet hits through 4 mm plate of St.3 steel at distance of 55 m.",
  "price": 42,
  "weight": 0.005,
  "maxStack": 50,
  "rarity": "none",
  "grid": {
    "color": {
      "r": 104,
      "g": 102,
      "b": 40,
      "a": 1
    },
    "height": 1,
    "width": 1
  },
  "_modified": 1571536468,
  "_kind": "ammunition",
  "caliber": "9x19mm Parabellum",
  "type": "bullet",
  "tracer": false,
  "tracerColor": "red",
  "subsonic": false,
  "velocity": 457,
  "ballisticCoef": 1,
  "damage": 56,
  "penetration": 18,
  "armorDamage": 33,
  "fragmentation": {
    "chance": 0.15,
    "min": 1,
    "max": 3
  },
  "projectiles": 0,
  "weaponModifier": {
    "accuracy": 0,
    "recoil": 0
  }
}

Armor

NameTypeDescription
typestringThe type of the armor e.g. body, helmet
armorobjectThe armor properties
penaltiesobjectThe penalties of the armor
blockingarrayBlocked zones e.g. earpiece, eyewear
slotsobjectModification slots of the armor
compatibilityobjectIf it’s an attachment to which it’s compatible

Armor properties

NameTypeDescription
classintThe armor class
durabilityfloatThe max durability of the armor
materialobjectMaterial properties of the armor
bluntThroughputfloatThe damage done to the target when the armor is not penetrated
zonesarrayThe zones protected by the armor

Material properties

NameTypeDescription
namestringName of the material
destructibilityfloatThe destructibility of the material

Penalties

NameTypeDescription
mousefloatMouse speed penalty
speedfloatMovement speed penalty
ergonomicsintErgonomics deduction
deafnessstringStrength of hearing reduction e.g. low, medium, high

Example

{
  "_id": "5b44d0de86f774503d30cba8",
  "name": "IOTV Gen4 armor (high mobility kit)",
  "shortName": "Gen4 HMK",
  "description": "The Improved Outer Tactical Vest (IOTV) Gen IV is designed to permit maximum freedom of movement required to assume correct firing positions with the agility to execute and maneuver tasks. Optimal design characteristics ensure the best possible weight distribution of both the ballistic body armor system as well as additional load bearing equipment, thus providing enhanced comfort, wear duration, and mobility. Increased mobility and comfort kit.",
  "price": 118774,
  "weight": 10,
  "maxStack": 1,
  "rarity": "superrare",
  "grid": {
    "color": {
      "r": 28,
      "g": 65,
      "b": 86,
      "a": 255
    },
    "height": 4,
    "width": 3
  },
  "_modified": 1571536471,
  "_kind": "armor",
  "type": "body",
  "armor": {
    "class": 5,
    "durability": 62,
    "material": {
      "name": "titanium",
      "destructibility": 0.45
    },
    "bluntThroughput": 0.22,
    "zones": [
      "chest",
      "stomach"
    ]
  },
  "penalties": {
    "mouse": -15,
    "speed": -11,
    "ergonomics": -11,
    "deafness": "none"
  },
  "blocking": [],
  "slots": {},
  "compatibility": {}
}

Backpack

NameTypeDescription
gridsarrayGrids of the backpack
penaltiesobjectThe penalties of the backpack

Grid

NameTypeDescription
idstringIdentifier of the grid
heightintThe grid height
widthintThe grid width
maxWeightfloatThe maximum weight of the grid
filterobjectCompatible items that fit into the grid (whitelist). No restriction when empty

Example

{
  "_id": "5b44c6ae86f7742d1627baea",
  "name": "Ana tactical Beta 2 battle backpack",
  "shortName": "Beta2",
  "description": "An lightweight and capacious backpack from Ana Tactical. Specially designed for use in dynamic conditions and on rough terrain.",
  "price": 50686,
  "weight": 1.1,
  "maxStack": 1,
  "rarity": "none",
  "grid": {
    "color": {
      "r": 76,
      "g": 42,
      "b": 85,
      "a": 1
    },
    "height": 5,
    "width": 5
  },
  "_modified": 1571536460,
  "_kind": "backpack",
  "grids": [
    {
      "id": "main",
      "height": 6,
      "width": 5,
      "maxWeight": 0,
      "filter": {}
    }
  ],
  "penalties": {
    "speed": -3
  }
}

Firearm

NameTypeDescription
typestringThe type of the firearm, e.g. primary, secondary
classstringThe weapon class, e.g. assaultCarbine, pistol, smg
caliberstringThe weapon caliber
rofintThe rate of fire of the weapon
burstRoundsintNumber of rounds per burst, if available
actionstringThe action type e.g. gas, recoil, bolt
modes[]stringThe fire modes of the weapon
velocityfloatThe muzzle velocity in meters per second
effectiveDistfloatThe maximum effective range of the weapon
ergonomicsfloatThe base ergonomics of the firearm
foldRectractableboolIndicates if the butstock is fold or rectractable
recoilVerticalfloatThe base vertical recoil of the weapon
recoilHorizontalfloatThe base horizontal recoil of the weapon
slotsobjectA map of the modification slots

Slot

NameTypeDescription
filterobjectA map of compatible item IDs categorized by kind
requiredboolIndicates whether the slot is required for an operational state

Example

{
  "_id": "574d967124597745970e7c94",
  "name": "Simonov Semi-Automatic Carbine SKS 7.62x39",
  "shortName": "SKS",
  "description": "Soviet semi-automatic carbine designed by Sergei Simonov for 7.62x39 cartridge and known abroad as SKS-45. Immensely popular both in CIS countries and in the West, this weapon is still in active service in some countries in form of various copies and modifications. This particular specimen comes from extended storage warehouses of Tula Arms Plant and haven't yet undergo the civilian weapon normalization procedure.",
  "price": 19331,
  "weight": 2.627,
  "maxStack": 1,
  "rarity": "rare",
  "grid": {
    "color": {
      "r": 0,
      "g": 0,
      "b": 0,
      "a": 1
    },
    "height": 1,
    "width": 4
  },
  "_modified": 1571536468,
  "_kind": "firearm",
  "type": "primary",
  "class": "assaultCarbine",
  "caliber": "7.62x39mm",
  "rof": 40,
  "action": "gas",
  "modes": [
    "single"
  ],
  "velocity": 0,
  "effectiveDist": 400,
  "ergonomics": 40,
  "foldRectractable": false,
  "recoilVertical": 182,
  "recoilHorizontal": 400,
  "slots": {
    "magazine": {
      "filter": {
        "magazine": [
          "5c5970672e221602b21d7855",
          "587df583245977373c4f1129",
          "587df3a12459772c28142567"
        ]
      },
      "required": false
    },
    "muzzle": {
      "filter": {
        "modificationMuzzle": [
          "593d490386f7745ee97a1555"
        ]
      },
      "required": false
    },
    "sightRear": {
      "filter": {
        "modificationSight": [
          "574db213245977459a2f3f5d"
        ]
      },
      "required": false
    },
    "stock": {
      "filter": {
        "modificationStock": [
          "587e0531245977466077a0f7",
          "5afd7ded5acfc40017541f5e",
          "574dad8024597745964bf05c"
        ]
      },
      "required": true
    }
  }
}

Modification

NameTypeDescription
ergonomicsintThe ergonomics modifier of the modification
raidModdableintIndicates if the modification is moddable in Raid. 0 = no, 1 = yes, 2 = only with a tool
gridModifierobjectThe modifiers that influence the grid properties of the parent
slotsobjectA map of the modification slots
compatibilityobjectA map of compatible item IDs (reverse) categorized by kind
conflictsobjectA map of item IDs to conflict with, categorized by kind

Grid Modifier

NameTypeDescription
heightintThe grid height modifier
widthintThe grid width modifier

Slot

NameTypeDescription
filterobjectA map with compatible item IDs categorized by kind
requiredboolIndicates whether the slot is required for an operational state

Example

{
  "_id": "5c90c3622e221601da359851",
  "name": "B-13V rail platform above reciever \"Classic\"",
  "shortName": "B-13V",
  "description": "The B-13 rail platform above receiver mounts on the standard Dovetail joint located on the PP-19-01 \"Vityaz\". Provides a platform for sighting devices.",
  "price": 7600,
  "weight": 0.158,
  "maxStack": 1,
  "rarity": "none",
  "grid": {
    "color": {
      "r": 28,
      "g": 65,
      "b": 86,
      "a": 1
    },
    "height": 1,
    "width": 1
  },
  "_modified": 1571536473,
  "_kind": "modificationMount",
  "ergonomics": 0,
  "raidModdable": 1,
  "gridModifier": {
    "height": 0,
    "width": 0
  },
  "slots": {
    "scope_00": {
      "filter": {
        "modificationMount": [
          "58d39d3d86f77445bb794ae7",
          "5c7d55f52e221644f31bff6a",
          "5b3b6dc75acfc47a8773fb1e",
          "5b2389515acfc4771e1be0c0",
          "577d128124597739d65d0e56",
          "5c86592b2e2216000e69e77c",
          "5a37ca54c4a282000d72296a",
          "58d2664f86f7747fec5834f6",
          "57c69dd424597774c03b7bbc",
          "5b3b99265acfc4704b4a1afb",
          "5aa66a9be5b5b0214e506e89",
          "5aa66c72e5b5b00016327c93",
          "5c1cdd302e221602b3137250",
          "5b31163c5acfc400153b71cb",
          "5a33b652c4a28232996e407c",
          "5a33b2c9c4a282000c5a9511",
          "59db7eed86f77461f8380365",
          "5a1ead28fcdbcb001912fa9f"
        ],
        "modificationSight": [
          "57ac965c24597706be5f975c",
          "57aca93d2459771f2c7e26db",
          "544a3a774bdc2d3a388b4567",
          "57adff4f24597737f373b6e6",
          "5c0517910db83400232ffee5",
          "591c4efa86f7741030027726",
          "570fd79bd2720bc7458b4583",
          "570fd6c2d2720bc6458b457f",
          "558022b54bdc2dac148b458d",
          "5c07dd120db834001c39092d",
          "5c0a2cec0db834001b7ce47d",
          "58491f3324597764bc48fa02",
          "584924ec24597768f12ae244",
          "5b30b0dc5acfc400153b7124",
          "5c0505e00db834001b735073",
          "584984812459776a704a82a6",
          "59f9d81586f7744c7506ee62",
          "570fd721d2720bc5458b4596",
          "57ae0171245977343c27bfcf"
        ]
      },
      "required": false
    }
  },
  "compatibility": {
    "firearm": [
      "57838ad32459774a17445cd2",
      "576165642459773c7a400233",
      "5c46fbd72e2216398b5a8c9c",
      "5839a40f24597726f856b511",
      "5ac66cb05acfc40198510a10",
      "5c501a4d2e221602b412b540",
      "57c44b372459772d2b39b8ce",
      "5a0ec13bfcdbcb00165aa685",
      "5ac4cd105acfc40016339859",
      "5ac66d725acfc43b321d4b60",
      "5ab8e9fcd8ce870019439434",
      "5644bd2b4bdc2d3b4c8b4572",
      "59984ab886f7743e98271174",
      "5ac66d2e5acfc43b321d4b53",
      "583990e32459771419544dd2",
      "5ac66d9b5acfc4001633997a",
      "5abcbc27d8ce8700182eceeb",
      "5ac66d015acfc400180ae6e4"
    ]
  },
  "conflicts": {
    "modificationMount": [
      "5648b6ff4bdc2d3d1c8b4581"
    ],
    "modificationReceiver": [
      "59985a6c86f77414ec448d17"
    ],
    "modificationSight": [
      "5c82342f2e221644f31c060e",
      "576fd4ec2459777f0b518431",
      "5c82343a2e221644f31c0611"
    ]
  }
}