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.
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.
Follow these steps to obtain an access token using the Client Credentials Flow:
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",
}
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.
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,
}
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>
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!
Name | Type | Description |
_id | string | The ID of the item |
name | string | The name of the item |
shortName | string | The short name of the item |
description | string | The description of the item |
price | int | The base price in rubles of the item |
weight | float | The weight of the item |
maxStack | int | The maximum stack size of the item |
rarity | string | The rarity of the item |
grid | object | The grid properties of the item |
_modified | int | The modified date as Unix timestamp |
_kind | string | The entity type of the item |
Name | Type | Description |
color | object | The grid background color in RGBA |
height | int | The grid height of the item |
width | int | The grid width of the item |
Name | Type | Description |
r | uint | Red channel |
g | uint | Green channel |
b | uint | Blue channel |
a | uint | Alpha channel |
{
"_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"
}
Name | Type | Description |
caliber | string | The caliber of the ammunition |
type | string | The type of the ammunition |
tracer | bool | Indicates if it’s tracer ammunition |
tracerColor | string | The tracer color |
subsonic | bool | Indicates if it’s subsonic ammo |
velocity | float | Velocity of the projectile(s) in meters per second |
ballisticCoef | float | The ballistic coeficient of the ammo |
damage | float | The flesh damage of the ammo |
penetration | float | The penetration power of the ammo |
armorDamage | float | The damage done to an armor |
fragmentation | object | The fragmentation properties of the ammo |
effects | object | Various effects of the ammo |
pellets | int | DEPRCATED The pellet count of the ammo if it’s buckshot |
projectiles | int | The projectile count, relevant to e.g. buckshot or flechette rounds |
weaponModifier | object | The fragmentation properties of the ammo |
Name | Type | Description |
chance | float | The penetration chance of the ammunition |
min | int | The minimal fragment count |
max | int | Indicates if it’s tracer ammunition |
Name | Type | Description |
lightBleedingChance | float | Percentage value increases or decreases the chance of light bleeding |
heavyBleedingChance | float | Percentage value increases or decreases the chance of heavy bleeding |
Name | Type | Description |
accuracy | float | Modifier for weapon accuracy (percent) |
recoil | float | Modifier for weapon recoil (percent) |
{
"_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
}
}
Name | Type | Description |
type | string | The type of the armor e.g. body, helmet |
armor | object | The armor properties |
penalties | object | The penalties of the armor |
blocking | array | Blocked zones e.g. earpiece, eyewear |
slots | object | Modification slots of the armor |
compatibility | object | If it’s an attachment to which it’s compatible |
Name | Type | Description |
class | int | The armor class |
durability | float | The max durability of the armor |
material | object | Material properties of the armor |
bluntThroughput | float | The damage done to the target when the armor is not penetrated |
zones | array | The zones protected by the armor |
Name | Type | Description |
name | string | Name of the material |
destructibility | float | The destructibility of the material |
Name | Type | Description |
mouse | float | Mouse speed penalty |
speed | float | Movement speed penalty |
ergonomics | int | Ergonomics deduction |
deafness | string | Strength of hearing reduction e.g. low, medium, high |
{
"_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": {}
}
Name | Type | Description |
grids | array | Grids of the backpack |
penalties | object | The penalties of the backpack |
Name | Type | Description |
id | string | Identifier of the grid |
height | int | The grid height |
width | int | The grid width |
maxWeight | float | The maximum weight of the grid |
filter | object | Compatible items that fit into the grid (whitelist). No restriction when empty |
{
"_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
}
}
Name | Type | Description |
type | string | The type of the firearm, e.g. primary , secondary |
class | string | The weapon class, e.g. assaultCarbine , pistol , smg |
caliber | string | The weapon caliber |
rof | int | The rate of fire of the weapon |
burstRounds | int | Number of rounds per burst, if available |
action | string | The action type e.g. gas , recoil , bolt |
modes | []string | The fire modes of the weapon |
velocity | float | The muzzle velocity in meters per second |
effectiveDist | float | The maximum effective range of the weapon |
ergonomics | float | The base ergonomics of the firearm |
foldRectractable | bool | Indicates if the butstock is fold or rectractable |
recoilVertical | float | The base vertical recoil of the weapon |
recoilHorizontal | float | The base horizontal recoil of the weapon |
slots | object | A map of the modification slots |
Name | Type | Description |
filter | object | A map of compatible item IDs categorized by kind |
required | bool | Indicates whether the slot is required for an operational state |
{
"_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
}
}
}
Name | Type | Description |
ergonomics | int | The ergonomics modifier of the modification |
raidModdable | int | Indicates if the modification is moddable in Raid. 0 = no, 1 = yes, 2 = only with a tool |
gridModifier | object | The modifiers that influence the grid properties of the parent |
slots | object | A map of the modification slots |
compatibility | object | A map of compatible item IDs (reverse) categorized by kind |
conflicts | object | A map of item IDs to conflict with, categorized by kind |
Name | Type | Description |
height | int | The grid height modifier |
width | int | The grid width modifier |
Name | Type | Description |
filter | object | A map with compatible item IDs categorized by kind |
required | bool | Indicates whether the slot is required for an operational state |
{
"_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"
]
}
}