[{"data":1,"prerenderedAt":2980},["ShallowReactive",2],{"article-cs2-inventory-with-floats-using-csinventoryapi-nodejs":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"image":11,"tags":12,"body":17,"_type":2974,"_id":2975,"_source":2976,"_file":2977,"_stem":2978,"_extension":2979},"\u002Farticles\u002Fcs2-inventory-with-floats-using-csinventoryapi-nodejs","articles",false,"","[DEPRECATED] Fetch CS2 Inventory with Floats using CSInventoryAPI (NodeJS)","Deprecated guide: fetch CS2 inventory floats with CSInventoryAPI’s inspect endpoint in NodeJS. Valve inspect-link changes from March 2026 broke this flow.","2024-10-11","\u002Fimg\u002Farticles\u002Fcs2-inventory-with-floats\u002Fitem-floats.jpg",[13,14,15,16],"Steam","CS2","NodeJS","Education",{"type":18,"children":19,"toc":2964},"root",[20,30,53,74,81,94,102,107,116,129,134,184,190,203,208,216,221,229,236,242,255,269,276,281,925,930,936,941,1469,1482,1487,1569,1574,1824,1837,1843,1848,2621,2633,2638,2935,2941,2946,2958],{"type":21,"tag":22,"props":23,"children":24},"element","p",{},[25],{"type":21,"tag":26,"props":27,"children":29},"img",{"alt":28,"src":11},"Fetch CS2 Inventory with Floats using CSInventoryAPI",[],{"type":21,"tag":22,"props":31,"children":32},{},[33,40,42,51],{"type":21,"tag":34,"props":35,"children":36},"strong",{},[37],{"type":38,"value":39},"text","Update March 14th, 2026:",{"type":38,"value":41}," Valve pushed an update to inspect links last night, rendering this guide deprecated. After updating ",{"type":21,"tag":43,"props":44,"children":48},"a",{"href":45,"rel":46},"https:\u002F\u002Fcsinventoryapi.com\u002F",[47],"nofollow",[49],{"type":38,"value":50},"CSInventoryAPI",{"type":38,"value":52}," I'll probably add a new blog post explaining the changes paired with a new guide.",{"type":21,"tag":22,"props":54,"children":55},{},[56,58,63,65,72],{"type":38,"value":57},"In an attempt to make ",{"type":21,"tag":43,"props":59,"children":61},{"href":45,"rel":60},[47],[62],{"type":38,"value":50},{"type":38,"value":64}," more accessible, I figured I would put together a quick article detailing how to successfully use our most popular endpoint, the inspect API (",{"type":21,"tag":66,"props":67,"children":69},"code",{"className":68},[],[70],{"type":38,"value":71},"\u002Fapi\u002Fv1\u002Finspect",{"type":38,"value":73},").",{"type":21,"tag":75,"props":76,"children":78},"h2",{"id":77},"the-url-property",[79],{"type":38,"value":80},"The ?url= property",{"type":21,"tag":22,"props":82,"children":83},{},[84,86,92],{"type":38,"value":85},"The only thing we need to obtain the advanced item info for a specific item is the ",{"type":21,"tag":87,"props":88,"children":89},"em",{},[90],{"type":38,"value":91},"inspect url",{"type":38,"value":93},", most easily found by navigating to your own inventory, clicking an item, and finding the \"Inspect in Game...\" button.",{"type":21,"tag":22,"props":95,"children":96},{},[97],{"type":21,"tag":26,"props":98,"children":101},{"alt":99,"src":100},"Inspect in Game link in a CS2 inventory","\u002Fimg\u002Farticles\u002Fcs2-inventory-with-floats\u002Finspect-in-game.png",[],{"type":21,"tag":22,"props":103,"children":104},{},[105],{"type":38,"value":106},"If you copy that link address, you will find something with a close resemblance to:",{"type":21,"tag":108,"props":109,"children":111},"pre",{"code":110},"steam:\u002F\u002Frungame\u002F730\u002F76561202255233023\u002F+csgo_econ_action_preview%20S76561198166295458A38739886639D768787693327487156\n",[112],{"type":21,"tag":66,"props":113,"children":114},{"__ignoreMap":7},[115],{"type":38,"value":110},{"type":21,"tag":22,"props":117,"children":118},{},[119,121,127],{"type":38,"value":120},"Now, the most important parts of this url is what happens near the end, after the ",{"type":21,"tag":66,"props":122,"children":124},{"className":123},[],[125],{"type":38,"value":126},"%20",{"type":38,"value":128}," (space).",{"type":21,"tag":22,"props":130,"children":131},{},[132],{"type":38,"value":133},"There are three letters that separate the different sequences of numbers:",{"type":21,"tag":135,"props":136,"children":137},"ul",{},[138,157,174],{"type":21,"tag":139,"props":140,"children":141},"li",{},[142,147,149,155],{"type":21,"tag":34,"props":143,"children":144},{},[145],{"type":38,"value":146},"S",{"type":38,"value":148}," (steamid64, in this case ",{"type":21,"tag":66,"props":150,"children":152},{"className":151},[],[153],{"type":38,"value":154},"76561198166295458",{"type":38,"value":156},")",{"type":21,"tag":139,"props":158,"children":159},{},[160,165,167,173],{"type":21,"tag":34,"props":161,"children":162},{},[163],{"type":38,"value":164},"A",{"type":38,"value":166}," (assetid of the item, in this case ",{"type":21,"tag":66,"props":168,"children":170},{"className":169},[],[171],{"type":38,"value":172},"38739886639",{"type":38,"value":156},{"type":21,"tag":139,"props":175,"children":176},{},[177,182],{"type":21,"tag":34,"props":178,"children":179},{},[180],{"type":38,"value":181},"D",{"type":38,"value":183}," (a random number as far as I know, we will not have to worry about this).",{"type":21,"tag":75,"props":185,"children":187},{"id":186},"testing-the-inspect-endpoint",[188],{"type":38,"value":189},"Testing the inspect endpoint",{"type":21,"tag":22,"props":191,"children":192},{},[193,195,201],{"type":38,"value":194},"Armed with this inspect link, you can try out the endpoint using the swagger UI available at ",{"type":21,"tag":43,"props":196,"children":199},{"href":197,"rel":198},"https:\u002F\u002Fcsinventoryapi.com\u002Fdocs",[47],[200],{"type":38,"value":197},{"type":38,"value":202},".",{"type":21,"tag":22,"props":204,"children":205},{},[206],{"type":38,"value":207},"Add your API key and the url, then press execute.",{"type":21,"tag":22,"props":209,"children":210},{},[211],{"type":21,"tag":26,"props":212,"children":215},{"alt":213,"src":214},"CSInventoryAPI swagger UI inspect endpoint","\u002Fimg\u002Farticles\u002Fcs2-inventory-with-floats\u002Fswagger-inspect.png",[],{"type":21,"tag":22,"props":217,"children":218},{},[219],{"type":38,"value":220},"If all works well, you should receive an output similar to this:",{"type":21,"tag":22,"props":222,"children":223},{},[224],{"type":21,"tag":26,"props":225,"children":228},{"alt":226,"src":227},"Inspect API response showing floatvalue","\u002Fimg\u002Farticles\u002Fcs2-inventory-with-floats\u002Finspect-response.png",[],{"type":21,"tag":22,"props":230,"children":233},{"className":231},[232],"img-caption",[234],{"type":38,"value":235},"\"floatvalue\" is the property that shows the float of the item in question.",{"type":21,"tag":75,"props":237,"children":239},{"id":238},"fetching-floats-of-items-in-an-inventory-using-nodejs",[240],{"type":38,"value":241},"Fetching floats of items in an inventory using NodeJS",{"type":21,"tag":22,"props":243,"children":244},{},[245,247,253],{"type":38,"value":246},"The crux of it is, when fetching an inventory (e.g., by using the ",{"type":21,"tag":43,"props":248,"children":251},{"href":249,"rel":250},"https:\u002F\u002Fcsinventoryapi.com\u002Fapi\u002Fv1\u002Finventory",[47],[252],{"type":38,"value":249},{"type":38,"value":254}," endpoint), the inspect url does not come pre-populated with the fields required to inspect the item, specifically the S and A properties are only filled with placeholders.",{"type":21,"tag":22,"props":256,"children":257},{},[258,260,267],{"type":38,"value":259},"The solution to this is however relatively straightforward. The S property is set to the steamid64 of the item's owner, and the A property is populated with the item's assetid. Let us see how to do this in practice (all code will be available on ",{"type":21,"tag":43,"props":261,"children":264},{"href":262,"rel":263},"https:\u002F\u002Fgithub.com\u002Fjkmsolutions\u002Finventory-with-floats",[47],[265],{"type":38,"value":266},"GitHub",{"type":38,"value":268},"):",{"type":21,"tag":270,"props":271,"children":273},"h3",{"id":272},"get-user-inventory",[274],{"type":38,"value":275},"Get user inventory",{"type":21,"tag":22,"props":277,"children":278},{},[279],{"type":38,"value":280},"Firstly, we'll build a method to retrieve a user's inventory (also using CSInventoryAPI to avoid rate limits imposed by Steam):",{"type":21,"tag":108,"props":282,"children":286},{"code":283,"language":284,"meta":7,"className":285,"style":7},"import axios from 'axios';\n\nconst API_KEY = process.env.CSINVENTORYAPI_API_KEY;\n\nif (!API_KEY) {\n    throw new Error('No API key provided');\n}\n\n\u002F**\n * Fetches the inventory of a user\n *\n * @param {string} steamid64 of the user\n * @returns {Promise\u003CInventory>} the user's inventory\n *\u002F\nconst getUserInventory = async (steamid64) => {\n    const response = await axios.get(\n        `https:\u002F\u002Fcsinventoryapi.com\u002Fapi\u002Fv1\u002Finventory?api_key=${API_KEY}&steamid64=${steamid64}`\n    );\n\n    if (response.data.success !== 1) {\n        throw new Error('Failed to fetch inventory');\n    }\n\n    if (response.data.total_inventory_count === 0) {\n        throw new Error('No items found.');\n    }\n\n    if (!response.data.assets || !response.data.descriptions) {\n        throw new Error('No assets found.');\n    }\n\n    return response.data;\n}\n","javascript","language-javascript shiki shiki-themes github-dark",[287],{"type":21,"tag":66,"props":288,"children":289},{"__ignoreMap":7},[290,324,334,368,376,405,440,449,457,467,476,485,514,537,546,593,631,658,667,675,703,733,742,750,777,806,814,822,858,887,895,903,917],{"type":21,"tag":291,"props":292,"children":295},"span",{"class":293,"line":294},"line",1,[296,302,308,313,319],{"type":21,"tag":291,"props":297,"children":299},{"style":298},"--shiki-default:#F97583",[300],{"type":38,"value":301},"import",{"type":21,"tag":291,"props":303,"children":305},{"style":304},"--shiki-default:#E1E4E8",[306],{"type":38,"value":307}," axios ",{"type":21,"tag":291,"props":309,"children":310},{"style":298},[311],{"type":38,"value":312},"from",{"type":21,"tag":291,"props":314,"children":316},{"style":315},"--shiki-default:#9ECBFF",[317],{"type":38,"value":318}," 'axios'",{"type":21,"tag":291,"props":320,"children":321},{"style":304},[322],{"type":38,"value":323},";\n",{"type":21,"tag":291,"props":325,"children":327},{"class":293,"line":326},2,[328],{"type":21,"tag":291,"props":329,"children":331},{"emptyLinePlaceholder":330},true,[332],{"type":38,"value":333},"\n",{"type":21,"tag":291,"props":335,"children":337},{"class":293,"line":336},3,[338,343,349,354,359,364],{"type":21,"tag":291,"props":339,"children":340},{"style":298},[341],{"type":38,"value":342},"const",{"type":21,"tag":291,"props":344,"children":346},{"style":345},"--shiki-default:#79B8FF",[347],{"type":38,"value":348}," API_KEY",{"type":21,"tag":291,"props":350,"children":351},{"style":298},[352],{"type":38,"value":353}," =",{"type":21,"tag":291,"props":355,"children":356},{"style":304},[357],{"type":38,"value":358}," process.env.",{"type":21,"tag":291,"props":360,"children":361},{"style":345},[362],{"type":38,"value":363},"CSINVENTORYAPI_API_KEY",{"type":21,"tag":291,"props":365,"children":366},{"style":304},[367],{"type":38,"value":323},{"type":21,"tag":291,"props":369,"children":371},{"class":293,"line":370},4,[372],{"type":21,"tag":291,"props":373,"children":374},{"emptyLinePlaceholder":330},[375],{"type":38,"value":333},{"type":21,"tag":291,"props":377,"children":379},{"class":293,"line":378},5,[380,385,390,395,400],{"type":21,"tag":291,"props":381,"children":382},{"style":298},[383],{"type":38,"value":384},"if",{"type":21,"tag":291,"props":386,"children":387},{"style":304},[388],{"type":38,"value":389}," (",{"type":21,"tag":291,"props":391,"children":392},{"style":298},[393],{"type":38,"value":394},"!",{"type":21,"tag":291,"props":396,"children":397},{"style":345},[398],{"type":38,"value":399},"API_KEY",{"type":21,"tag":291,"props":401,"children":402},{"style":304},[403],{"type":38,"value":404},") {\n",{"type":21,"tag":291,"props":406,"children":408},{"class":293,"line":407},6,[409,414,419,425,430,435],{"type":21,"tag":291,"props":410,"children":411},{"style":298},[412],{"type":38,"value":413},"    throw",{"type":21,"tag":291,"props":415,"children":416},{"style":298},[417],{"type":38,"value":418}," new",{"type":21,"tag":291,"props":420,"children":422},{"style":421},"--shiki-default:#B392F0",[423],{"type":38,"value":424}," Error",{"type":21,"tag":291,"props":426,"children":427},{"style":304},[428],{"type":38,"value":429},"(",{"type":21,"tag":291,"props":431,"children":432},{"style":315},[433],{"type":38,"value":434},"'No API key provided'",{"type":21,"tag":291,"props":436,"children":437},{"style":304},[438],{"type":38,"value":439},");\n",{"type":21,"tag":291,"props":441,"children":443},{"class":293,"line":442},7,[444],{"type":21,"tag":291,"props":445,"children":446},{"style":304},[447],{"type":38,"value":448},"}\n",{"type":21,"tag":291,"props":450,"children":452},{"class":293,"line":451},8,[453],{"type":21,"tag":291,"props":454,"children":455},{"emptyLinePlaceholder":330},[456],{"type":38,"value":333},{"type":21,"tag":291,"props":458,"children":460},{"class":293,"line":459},9,[461],{"type":21,"tag":291,"props":462,"children":464},{"style":463},"--shiki-default:#6A737D",[465],{"type":38,"value":466},"\u002F**\n",{"type":21,"tag":291,"props":468,"children":470},{"class":293,"line":469},10,[471],{"type":21,"tag":291,"props":472,"children":473},{"style":463},[474],{"type":38,"value":475}," * Fetches the inventory of a user\n",{"type":21,"tag":291,"props":477,"children":479},{"class":293,"line":478},11,[480],{"type":21,"tag":291,"props":481,"children":482},{"style":463},[483],{"type":38,"value":484}," *\n",{"type":21,"tag":291,"props":486,"children":488},{"class":293,"line":487},12,[489,494,499,504,509],{"type":21,"tag":291,"props":490,"children":491},{"style":463},[492],{"type":38,"value":493}," * ",{"type":21,"tag":291,"props":495,"children":496},{"style":298},[497],{"type":38,"value":498},"@param",{"type":21,"tag":291,"props":500,"children":501},{"style":421},[502],{"type":38,"value":503}," {string}",{"type":21,"tag":291,"props":505,"children":506},{"style":304},[507],{"type":38,"value":508}," steamid64",{"type":21,"tag":291,"props":510,"children":511},{"style":463},[512],{"type":38,"value":513}," of the user\n",{"type":21,"tag":291,"props":515,"children":517},{"class":293,"line":516},13,[518,522,527,532],{"type":21,"tag":291,"props":519,"children":520},{"style":463},[521],{"type":38,"value":493},{"type":21,"tag":291,"props":523,"children":524},{"style":298},[525],{"type":38,"value":526},"@returns",{"type":21,"tag":291,"props":528,"children":529},{"style":421},[530],{"type":38,"value":531}," {Promise\u003CInventory>}",{"type":21,"tag":291,"props":533,"children":534},{"style":463},[535],{"type":38,"value":536}," the user's inventory\n",{"type":21,"tag":291,"props":538,"children":540},{"class":293,"line":539},14,[541],{"type":21,"tag":291,"props":542,"children":543},{"style":463},[544],{"type":38,"value":545}," *\u002F\n",{"type":21,"tag":291,"props":547,"children":549},{"class":293,"line":548},15,[550,554,559,563,568,572,578,583,588],{"type":21,"tag":291,"props":551,"children":552},{"style":298},[553],{"type":38,"value":342},{"type":21,"tag":291,"props":555,"children":556},{"style":421},[557],{"type":38,"value":558}," getUserInventory",{"type":21,"tag":291,"props":560,"children":561},{"style":298},[562],{"type":38,"value":353},{"type":21,"tag":291,"props":564,"children":565},{"style":298},[566],{"type":38,"value":567}," async",{"type":21,"tag":291,"props":569,"children":570},{"style":304},[571],{"type":38,"value":389},{"type":21,"tag":291,"props":573,"children":575},{"style":574},"--shiki-default:#FFAB70",[576],{"type":38,"value":577},"steamid64",{"type":21,"tag":291,"props":579,"children":580},{"style":304},[581],{"type":38,"value":582},") ",{"type":21,"tag":291,"props":584,"children":585},{"style":298},[586],{"type":38,"value":587},"=>",{"type":21,"tag":291,"props":589,"children":590},{"style":304},[591],{"type":38,"value":592}," {\n",{"type":21,"tag":291,"props":594,"children":596},{"class":293,"line":595},16,[597,602,607,611,616,621,626],{"type":21,"tag":291,"props":598,"children":599},{"style":298},[600],{"type":38,"value":601},"    const",{"type":21,"tag":291,"props":603,"children":604},{"style":345},[605],{"type":38,"value":606}," response",{"type":21,"tag":291,"props":608,"children":609},{"style":298},[610],{"type":38,"value":353},{"type":21,"tag":291,"props":612,"children":613},{"style":298},[614],{"type":38,"value":615}," await",{"type":21,"tag":291,"props":617,"children":618},{"style":304},[619],{"type":38,"value":620}," axios.",{"type":21,"tag":291,"props":622,"children":623},{"style":421},[624],{"type":38,"value":625},"get",{"type":21,"tag":291,"props":627,"children":628},{"style":304},[629],{"type":38,"value":630},"(\n",{"type":21,"tag":291,"props":632,"children":634},{"class":293,"line":633},17,[635,640,644,649,653],{"type":21,"tag":291,"props":636,"children":637},{"style":315},[638],{"type":38,"value":639},"        `https:\u002F\u002Fcsinventoryapi.com\u002Fapi\u002Fv1\u002Finventory?api_key=${",{"type":21,"tag":291,"props":641,"children":642},{"style":345},[643],{"type":38,"value":399},{"type":21,"tag":291,"props":645,"children":646},{"style":315},[647],{"type":38,"value":648},"}&steamid64=${",{"type":21,"tag":291,"props":650,"children":651},{"style":304},[652],{"type":38,"value":577},{"type":21,"tag":291,"props":654,"children":655},{"style":315},[656],{"type":38,"value":657},"}`\n",{"type":21,"tag":291,"props":659,"children":661},{"class":293,"line":660},18,[662],{"type":21,"tag":291,"props":663,"children":664},{"style":304},[665],{"type":38,"value":666},"    );\n",{"type":21,"tag":291,"props":668,"children":670},{"class":293,"line":669},19,[671],{"type":21,"tag":291,"props":672,"children":673},{"emptyLinePlaceholder":330},[674],{"type":38,"value":333},{"type":21,"tag":291,"props":676,"children":678},{"class":293,"line":677},20,[679,684,689,694,699],{"type":21,"tag":291,"props":680,"children":681},{"style":298},[682],{"type":38,"value":683},"    if",{"type":21,"tag":291,"props":685,"children":686},{"style":304},[687],{"type":38,"value":688}," (response.data.success ",{"type":21,"tag":291,"props":690,"children":691},{"style":298},[692],{"type":38,"value":693},"!==",{"type":21,"tag":291,"props":695,"children":696},{"style":345},[697],{"type":38,"value":698}," 1",{"type":21,"tag":291,"props":700,"children":701},{"style":304},[702],{"type":38,"value":404},{"type":21,"tag":291,"props":704,"children":706},{"class":293,"line":705},21,[707,712,716,720,724,729],{"type":21,"tag":291,"props":708,"children":709},{"style":298},[710],{"type":38,"value":711},"        throw",{"type":21,"tag":291,"props":713,"children":714},{"style":298},[715],{"type":38,"value":418},{"type":21,"tag":291,"props":717,"children":718},{"style":421},[719],{"type":38,"value":424},{"type":21,"tag":291,"props":721,"children":722},{"style":304},[723],{"type":38,"value":429},{"type":21,"tag":291,"props":725,"children":726},{"style":315},[727],{"type":38,"value":728},"'Failed to fetch inventory'",{"type":21,"tag":291,"props":730,"children":731},{"style":304},[732],{"type":38,"value":439},{"type":21,"tag":291,"props":734,"children":736},{"class":293,"line":735},22,[737],{"type":21,"tag":291,"props":738,"children":739},{"style":304},[740],{"type":38,"value":741},"    }\n",{"type":21,"tag":291,"props":743,"children":745},{"class":293,"line":744},23,[746],{"type":21,"tag":291,"props":747,"children":748},{"emptyLinePlaceholder":330},[749],{"type":38,"value":333},{"type":21,"tag":291,"props":751,"children":753},{"class":293,"line":752},24,[754,758,763,768,773],{"type":21,"tag":291,"props":755,"children":756},{"style":298},[757],{"type":38,"value":683},{"type":21,"tag":291,"props":759,"children":760},{"style":304},[761],{"type":38,"value":762}," (response.data.total_inventory_count ",{"type":21,"tag":291,"props":764,"children":765},{"style":298},[766],{"type":38,"value":767},"===",{"type":21,"tag":291,"props":769,"children":770},{"style":345},[771],{"type":38,"value":772}," 0",{"type":21,"tag":291,"props":774,"children":775},{"style":304},[776],{"type":38,"value":404},{"type":21,"tag":291,"props":778,"children":780},{"class":293,"line":779},25,[781,785,789,793,797,802],{"type":21,"tag":291,"props":782,"children":783},{"style":298},[784],{"type":38,"value":711},{"type":21,"tag":291,"props":786,"children":787},{"style":298},[788],{"type":38,"value":418},{"type":21,"tag":291,"props":790,"children":791},{"style":421},[792],{"type":38,"value":424},{"type":21,"tag":291,"props":794,"children":795},{"style":304},[796],{"type":38,"value":429},{"type":21,"tag":291,"props":798,"children":799},{"style":315},[800],{"type":38,"value":801},"'No items found.'",{"type":21,"tag":291,"props":803,"children":804},{"style":304},[805],{"type":38,"value":439},{"type":21,"tag":291,"props":807,"children":809},{"class":293,"line":808},26,[810],{"type":21,"tag":291,"props":811,"children":812},{"style":304},[813],{"type":38,"value":741},{"type":21,"tag":291,"props":815,"children":817},{"class":293,"line":816},27,[818],{"type":21,"tag":291,"props":819,"children":820},{"emptyLinePlaceholder":330},[821],{"type":38,"value":333},{"type":21,"tag":291,"props":823,"children":825},{"class":293,"line":824},28,[826,830,834,838,843,848,853],{"type":21,"tag":291,"props":827,"children":828},{"style":298},[829],{"type":38,"value":683},{"type":21,"tag":291,"props":831,"children":832},{"style":304},[833],{"type":38,"value":389},{"type":21,"tag":291,"props":835,"children":836},{"style":298},[837],{"type":38,"value":394},{"type":21,"tag":291,"props":839,"children":840},{"style":304},[841],{"type":38,"value":842},"response.data.assets ",{"type":21,"tag":291,"props":844,"children":845},{"style":298},[846],{"type":38,"value":847},"||",{"type":21,"tag":291,"props":849,"children":850},{"style":298},[851],{"type":38,"value":852}," !",{"type":21,"tag":291,"props":854,"children":855},{"style":304},[856],{"type":38,"value":857},"response.data.descriptions) {\n",{"type":21,"tag":291,"props":859,"children":861},{"class":293,"line":860},29,[862,866,870,874,878,883],{"type":21,"tag":291,"props":863,"children":864},{"style":298},[865],{"type":38,"value":711},{"type":21,"tag":291,"props":867,"children":868},{"style":298},[869],{"type":38,"value":418},{"type":21,"tag":291,"props":871,"children":872},{"style":421},[873],{"type":38,"value":424},{"type":21,"tag":291,"props":875,"children":876},{"style":304},[877],{"type":38,"value":429},{"type":21,"tag":291,"props":879,"children":880},{"style":315},[881],{"type":38,"value":882},"'No assets found.'",{"type":21,"tag":291,"props":884,"children":885},{"style":304},[886],{"type":38,"value":439},{"type":21,"tag":291,"props":888,"children":890},{"class":293,"line":889},30,[891],{"type":21,"tag":291,"props":892,"children":893},{"style":304},[894],{"type":38,"value":741},{"type":21,"tag":291,"props":896,"children":898},{"class":293,"line":897},31,[899],{"type":21,"tag":291,"props":900,"children":901},{"emptyLinePlaceholder":330},[902],{"type":38,"value":333},{"type":21,"tag":291,"props":904,"children":906},{"class":293,"line":905},32,[907,912],{"type":21,"tag":291,"props":908,"children":909},{"style":298},[910],{"type":38,"value":911},"    return",{"type":21,"tag":291,"props":913,"children":914},{"style":304},[915],{"type":38,"value":916}," response.data;\n",{"type":21,"tag":291,"props":918,"children":920},{"class":293,"line":919},33,[921],{"type":21,"tag":291,"props":922,"children":923},{"style":304},[924],{"type":38,"value":448},{"type":21,"tag":22,"props":926,"children":927},{},[928],{"type":38,"value":929},"Simple method to fetch user inventory w\u002F some error handling.",{"type":21,"tag":270,"props":931,"children":933},{"id":932},"parse-user-inventory",[934],{"type":38,"value":935},"Parse user inventory",{"type":21,"tag":22,"props":937,"children":938},{},[939],{"type":38,"value":940},"Armed with this data, and given that the user have items in their inventory, we can go ahead and parse it into a more manageable array of items (Steam divides the assets and the descriptions, why this is a necessary step in most applications utilising inventory fetching).",{"type":21,"tag":108,"props":942,"children":944},{"code":943,"language":284,"meta":7,"className":285,"style":7},"\u002F**\n *\n * @param {Inventory} inventory\n * @returns {Promise\u003CParsedInventoryItem[]>}\n *\u002F\nconst parseInventory = async (inventory) => {\n    const parsedInventory = [];\n\n    for (let i = 0; i \u003C inventory.assets.length; i++) {\n        const asset = inventory.assets[i];\n        const description = inventory.descriptions.find(d => d.classid === asset.classid);\n\n        if (!description) {\n            continue;\n        }\n\n        parsedInventory.push({\n            appid: asset.appid,\n            classid: asset.classid,\n            instanceid: asset.instanceid,\n            assetid: asset.assetid,\n            contextid: asset.contextid,\n            icon_url: description.icon_url,\n            tradable: description.tradable,\n            inspect_url: description.actions && description.actions[0] && description.actions[0].link || null,\n            name: description.name,\n            market_hash_name: description.market_hash_name,\n            name_color: description.name_color\n        });\n    }\n\n    return parsedInventory;\n}\n",[945],{"type":21,"tag":66,"props":946,"children":947},{"__ignoreMap":7},[948,955,962,983,999,1006,1047,1068,1075,1140,1162,1216,1223,1244,1256,1264,1271,1289,1297,1305,1313,1321,1329,1337,1345,1404,1412,1420,1428,1436,1443,1450,1462],{"type":21,"tag":291,"props":949,"children":950},{"class":293,"line":294},[951],{"type":21,"tag":291,"props":952,"children":953},{"style":463},[954],{"type":38,"value":466},{"type":21,"tag":291,"props":956,"children":957},{"class":293,"line":326},[958],{"type":21,"tag":291,"props":959,"children":960},{"style":463},[961],{"type":38,"value":484},{"type":21,"tag":291,"props":963,"children":964},{"class":293,"line":336},[965,969,973,978],{"type":21,"tag":291,"props":966,"children":967},{"style":463},[968],{"type":38,"value":493},{"type":21,"tag":291,"props":970,"children":971},{"style":298},[972],{"type":38,"value":498},{"type":21,"tag":291,"props":974,"children":975},{"style":421},[976],{"type":38,"value":977}," {Inventory}",{"type":21,"tag":291,"props":979,"children":980},{"style":304},[981],{"type":38,"value":982}," inventory\n",{"type":21,"tag":291,"props":984,"children":985},{"class":293,"line":370},[986,990,994],{"type":21,"tag":291,"props":987,"children":988},{"style":463},[989],{"type":38,"value":493},{"type":21,"tag":291,"props":991,"children":992},{"style":298},[993],{"type":38,"value":526},{"type":21,"tag":291,"props":995,"children":996},{"style":421},[997],{"type":38,"value":998}," {Promise\u003CParsedInventoryItem[]>}\n",{"type":21,"tag":291,"props":1000,"children":1001},{"class":293,"line":378},[1002],{"type":21,"tag":291,"props":1003,"children":1004},{"style":463},[1005],{"type":38,"value":545},{"type":21,"tag":291,"props":1007,"children":1008},{"class":293,"line":407},[1009,1013,1018,1022,1026,1030,1035,1039,1043],{"type":21,"tag":291,"props":1010,"children":1011},{"style":298},[1012],{"type":38,"value":342},{"type":21,"tag":291,"props":1014,"children":1015},{"style":421},[1016],{"type":38,"value":1017}," parseInventory",{"type":21,"tag":291,"props":1019,"children":1020},{"style":298},[1021],{"type":38,"value":353},{"type":21,"tag":291,"props":1023,"children":1024},{"style":298},[1025],{"type":38,"value":567},{"type":21,"tag":291,"props":1027,"children":1028},{"style":304},[1029],{"type":38,"value":389},{"type":21,"tag":291,"props":1031,"children":1032},{"style":574},[1033],{"type":38,"value":1034},"inventory",{"type":21,"tag":291,"props":1036,"children":1037},{"style":304},[1038],{"type":38,"value":582},{"type":21,"tag":291,"props":1040,"children":1041},{"style":298},[1042],{"type":38,"value":587},{"type":21,"tag":291,"props":1044,"children":1045},{"style":304},[1046],{"type":38,"value":592},{"type":21,"tag":291,"props":1048,"children":1049},{"class":293,"line":442},[1050,1054,1059,1063],{"type":21,"tag":291,"props":1051,"children":1052},{"style":298},[1053],{"type":38,"value":601},{"type":21,"tag":291,"props":1055,"children":1056},{"style":345},[1057],{"type":38,"value":1058}," parsedInventory",{"type":21,"tag":291,"props":1060,"children":1061},{"style":298},[1062],{"type":38,"value":353},{"type":21,"tag":291,"props":1064,"children":1065},{"style":304},[1066],{"type":38,"value":1067}," [];\n",{"type":21,"tag":291,"props":1069,"children":1070},{"class":293,"line":451},[1071],{"type":21,"tag":291,"props":1072,"children":1073},{"emptyLinePlaceholder":330},[1074],{"type":38,"value":333},{"type":21,"tag":291,"props":1076,"children":1077},{"class":293,"line":459},[1078,1083,1087,1092,1097,1102,1106,1111,1116,1121,1126,1131,1136],{"type":21,"tag":291,"props":1079,"children":1080},{"style":298},[1081],{"type":38,"value":1082},"    for",{"type":21,"tag":291,"props":1084,"children":1085},{"style":304},[1086],{"type":38,"value":389},{"type":21,"tag":291,"props":1088,"children":1089},{"style":298},[1090],{"type":38,"value":1091},"let",{"type":21,"tag":291,"props":1093,"children":1094},{"style":304},[1095],{"type":38,"value":1096}," i ",{"type":21,"tag":291,"props":1098,"children":1099},{"style":298},[1100],{"type":38,"value":1101},"=",{"type":21,"tag":291,"props":1103,"children":1104},{"style":345},[1105],{"type":38,"value":772},{"type":21,"tag":291,"props":1107,"children":1108},{"style":304},[1109],{"type":38,"value":1110},"; i ",{"type":21,"tag":291,"props":1112,"children":1113},{"style":298},[1114],{"type":38,"value":1115},"\u003C",{"type":21,"tag":291,"props":1117,"children":1118},{"style":304},[1119],{"type":38,"value":1120}," inventory.assets.",{"type":21,"tag":291,"props":1122,"children":1123},{"style":345},[1124],{"type":38,"value":1125},"length",{"type":21,"tag":291,"props":1127,"children":1128},{"style":304},[1129],{"type":38,"value":1130},"; i",{"type":21,"tag":291,"props":1132,"children":1133},{"style":298},[1134],{"type":38,"value":1135},"++",{"type":21,"tag":291,"props":1137,"children":1138},{"style":304},[1139],{"type":38,"value":404},{"type":21,"tag":291,"props":1141,"children":1142},{"class":293,"line":469},[1143,1148,1153,1157],{"type":21,"tag":291,"props":1144,"children":1145},{"style":298},[1146],{"type":38,"value":1147},"        const",{"type":21,"tag":291,"props":1149,"children":1150},{"style":345},[1151],{"type":38,"value":1152}," asset",{"type":21,"tag":291,"props":1154,"children":1155},{"style":298},[1156],{"type":38,"value":353},{"type":21,"tag":291,"props":1158,"children":1159},{"style":304},[1160],{"type":38,"value":1161}," inventory.assets[i];\n",{"type":21,"tag":291,"props":1163,"children":1164},{"class":293,"line":478},[1165,1169,1174,1178,1183,1188,1192,1197,1202,1207,1211],{"type":21,"tag":291,"props":1166,"children":1167},{"style":298},[1168],{"type":38,"value":1147},{"type":21,"tag":291,"props":1170,"children":1171},{"style":345},[1172],{"type":38,"value":1173}," description",{"type":21,"tag":291,"props":1175,"children":1176},{"style":298},[1177],{"type":38,"value":353},{"type":21,"tag":291,"props":1179,"children":1180},{"style":304},[1181],{"type":38,"value":1182}," inventory.descriptions.",{"type":21,"tag":291,"props":1184,"children":1185},{"style":421},[1186],{"type":38,"value":1187},"find",{"type":21,"tag":291,"props":1189,"children":1190},{"style":304},[1191],{"type":38,"value":429},{"type":21,"tag":291,"props":1193,"children":1194},{"style":574},[1195],{"type":38,"value":1196},"d",{"type":21,"tag":291,"props":1198,"children":1199},{"style":298},[1200],{"type":38,"value":1201}," =>",{"type":21,"tag":291,"props":1203,"children":1204},{"style":304},[1205],{"type":38,"value":1206}," d.classid ",{"type":21,"tag":291,"props":1208,"children":1209},{"style":298},[1210],{"type":38,"value":767},{"type":21,"tag":291,"props":1212,"children":1213},{"style":304},[1214],{"type":38,"value":1215}," asset.classid);\n",{"type":21,"tag":291,"props":1217,"children":1218},{"class":293,"line":487},[1219],{"type":21,"tag":291,"props":1220,"children":1221},{"emptyLinePlaceholder":330},[1222],{"type":38,"value":333},{"type":21,"tag":291,"props":1224,"children":1225},{"class":293,"line":516},[1226,1231,1235,1239],{"type":21,"tag":291,"props":1227,"children":1228},{"style":298},[1229],{"type":38,"value":1230},"        if",{"type":21,"tag":291,"props":1232,"children":1233},{"style":304},[1234],{"type":38,"value":389},{"type":21,"tag":291,"props":1236,"children":1237},{"style":298},[1238],{"type":38,"value":394},{"type":21,"tag":291,"props":1240,"children":1241},{"style":304},[1242],{"type":38,"value":1243},"description) {\n",{"type":21,"tag":291,"props":1245,"children":1246},{"class":293,"line":539},[1247,1252],{"type":21,"tag":291,"props":1248,"children":1249},{"style":298},[1250],{"type":38,"value":1251},"            continue",{"type":21,"tag":291,"props":1253,"children":1254},{"style":304},[1255],{"type":38,"value":323},{"type":21,"tag":291,"props":1257,"children":1258},{"class":293,"line":548},[1259],{"type":21,"tag":291,"props":1260,"children":1261},{"style":304},[1262],{"type":38,"value":1263},"        }\n",{"type":21,"tag":291,"props":1265,"children":1266},{"class":293,"line":595},[1267],{"type":21,"tag":291,"props":1268,"children":1269},{"emptyLinePlaceholder":330},[1270],{"type":38,"value":333},{"type":21,"tag":291,"props":1272,"children":1273},{"class":293,"line":633},[1274,1279,1284],{"type":21,"tag":291,"props":1275,"children":1276},{"style":304},[1277],{"type":38,"value":1278},"        parsedInventory.",{"type":21,"tag":291,"props":1280,"children":1281},{"style":421},[1282],{"type":38,"value":1283},"push",{"type":21,"tag":291,"props":1285,"children":1286},{"style":304},[1287],{"type":38,"value":1288},"({\n",{"type":21,"tag":291,"props":1290,"children":1291},{"class":293,"line":660},[1292],{"type":21,"tag":291,"props":1293,"children":1294},{"style":304},[1295],{"type":38,"value":1296},"            appid: asset.appid,\n",{"type":21,"tag":291,"props":1298,"children":1299},{"class":293,"line":669},[1300],{"type":21,"tag":291,"props":1301,"children":1302},{"style":304},[1303],{"type":38,"value":1304},"            classid: asset.classid,\n",{"type":21,"tag":291,"props":1306,"children":1307},{"class":293,"line":677},[1308],{"type":21,"tag":291,"props":1309,"children":1310},{"style":304},[1311],{"type":38,"value":1312},"            instanceid: asset.instanceid,\n",{"type":21,"tag":291,"props":1314,"children":1315},{"class":293,"line":705},[1316],{"type":21,"tag":291,"props":1317,"children":1318},{"style":304},[1319],{"type":38,"value":1320},"            assetid: asset.assetid,\n",{"type":21,"tag":291,"props":1322,"children":1323},{"class":293,"line":735},[1324],{"type":21,"tag":291,"props":1325,"children":1326},{"style":304},[1327],{"type":38,"value":1328},"            contextid: asset.contextid,\n",{"type":21,"tag":291,"props":1330,"children":1331},{"class":293,"line":744},[1332],{"type":21,"tag":291,"props":1333,"children":1334},{"style":304},[1335],{"type":38,"value":1336},"            icon_url: description.icon_url,\n",{"type":21,"tag":291,"props":1338,"children":1339},{"class":293,"line":752},[1340],{"type":21,"tag":291,"props":1341,"children":1342},{"style":304},[1343],{"type":38,"value":1344},"            tradable: description.tradable,\n",{"type":21,"tag":291,"props":1346,"children":1347},{"class":293,"line":779},[1348,1353,1358,1363,1368,1373,1377,1381,1385,1390,1394,1399],{"type":21,"tag":291,"props":1349,"children":1350},{"style":304},[1351],{"type":38,"value":1352},"            inspect_url: description.actions ",{"type":21,"tag":291,"props":1354,"children":1355},{"style":298},[1356],{"type":38,"value":1357},"&&",{"type":21,"tag":291,"props":1359,"children":1360},{"style":304},[1361],{"type":38,"value":1362}," description.actions[",{"type":21,"tag":291,"props":1364,"children":1365},{"style":345},[1366],{"type":38,"value":1367},"0",{"type":21,"tag":291,"props":1369,"children":1370},{"style":304},[1371],{"type":38,"value":1372},"] ",{"type":21,"tag":291,"props":1374,"children":1375},{"style":298},[1376],{"type":38,"value":1357},{"type":21,"tag":291,"props":1378,"children":1379},{"style":304},[1380],{"type":38,"value":1362},{"type":21,"tag":291,"props":1382,"children":1383},{"style":345},[1384],{"type":38,"value":1367},{"type":21,"tag":291,"props":1386,"children":1387},{"style":304},[1388],{"type":38,"value":1389},"].link ",{"type":21,"tag":291,"props":1391,"children":1392},{"style":298},[1393],{"type":38,"value":847},{"type":21,"tag":291,"props":1395,"children":1396},{"style":345},[1397],{"type":38,"value":1398}," null",{"type":21,"tag":291,"props":1400,"children":1401},{"style":304},[1402],{"type":38,"value":1403},",\n",{"type":21,"tag":291,"props":1405,"children":1406},{"class":293,"line":808},[1407],{"type":21,"tag":291,"props":1408,"children":1409},{"style":304},[1410],{"type":38,"value":1411},"            name: description.name,\n",{"type":21,"tag":291,"props":1413,"children":1414},{"class":293,"line":816},[1415],{"type":21,"tag":291,"props":1416,"children":1417},{"style":304},[1418],{"type":38,"value":1419},"            market_hash_name: description.market_hash_name,\n",{"type":21,"tag":291,"props":1421,"children":1422},{"class":293,"line":824},[1423],{"type":21,"tag":291,"props":1424,"children":1425},{"style":304},[1426],{"type":38,"value":1427},"            name_color: description.name_color\n",{"type":21,"tag":291,"props":1429,"children":1430},{"class":293,"line":860},[1431],{"type":21,"tag":291,"props":1432,"children":1433},{"style":304},[1434],{"type":38,"value":1435},"        });\n",{"type":21,"tag":291,"props":1437,"children":1438},{"class":293,"line":889},[1439],{"type":21,"tag":291,"props":1440,"children":1441},{"style":304},[1442],{"type":38,"value":741},{"type":21,"tag":291,"props":1444,"children":1445},{"class":293,"line":897},[1446],{"type":21,"tag":291,"props":1447,"children":1448},{"emptyLinePlaceholder":330},[1449],{"type":38,"value":333},{"type":21,"tag":291,"props":1451,"children":1452},{"class":293,"line":905},[1453,1457],{"type":21,"tag":291,"props":1454,"children":1455},{"style":298},[1456],{"type":38,"value":911},{"type":21,"tag":291,"props":1458,"children":1459},{"style":304},[1460],{"type":38,"value":1461}," parsedInventory;\n",{"type":21,"tag":291,"props":1463,"children":1464},{"class":293,"line":919},[1465],{"type":21,"tag":291,"props":1466,"children":1467},{"style":304},[1468],{"type":38,"value":448},{"type":21,"tag":22,"props":1470,"children":1471},{},[1472,1474,1480],{"type":38,"value":1473},"Some parsing is required to find the fields we are interested in (specifically the ",{"type":21,"tag":66,"props":1475,"children":1477},{"className":1476},[],[1478],{"type":38,"value":1479},"inspect_url",{"type":38,"value":1481},", which might not always be present. A sticker capsule, for instance, does not have an inspect url).",{"type":21,"tag":22,"props":1483,"children":1484},{},[1485],{"type":38,"value":1486},"If we now test running these methods using the following code:",{"type":21,"tag":108,"props":1488,"children":1490},{"code":1489,"language":284,"meta":7,"className":285,"style":7},"const inventory = await getUserInventory(steamid64);\nconst parsedInventory = await parseInventory(inventory);\nconsole.log(parsedInventory);\n",[1491],{"type":21,"tag":66,"props":1492,"children":1493},{"__ignoreMap":7},[1494,1523,1551],{"type":21,"tag":291,"props":1495,"children":1496},{"class":293,"line":294},[1497,1501,1506,1510,1514,1518],{"type":21,"tag":291,"props":1498,"children":1499},{"style":298},[1500],{"type":38,"value":342},{"type":21,"tag":291,"props":1502,"children":1503},{"style":345},[1504],{"type":38,"value":1505}," inventory",{"type":21,"tag":291,"props":1507,"children":1508},{"style":298},[1509],{"type":38,"value":353},{"type":21,"tag":291,"props":1511,"children":1512},{"style":298},[1513],{"type":38,"value":615},{"type":21,"tag":291,"props":1515,"children":1516},{"style":421},[1517],{"type":38,"value":558},{"type":21,"tag":291,"props":1519,"children":1520},{"style":304},[1521],{"type":38,"value":1522},"(steamid64);\n",{"type":21,"tag":291,"props":1524,"children":1525},{"class":293,"line":326},[1526,1530,1534,1538,1542,1546],{"type":21,"tag":291,"props":1527,"children":1528},{"style":298},[1529],{"type":38,"value":342},{"type":21,"tag":291,"props":1531,"children":1532},{"style":345},[1533],{"type":38,"value":1058},{"type":21,"tag":291,"props":1535,"children":1536},{"style":298},[1537],{"type":38,"value":353},{"type":21,"tag":291,"props":1539,"children":1540},{"style":298},[1541],{"type":38,"value":615},{"type":21,"tag":291,"props":1543,"children":1544},{"style":421},[1545],{"type":38,"value":1017},{"type":21,"tag":291,"props":1547,"children":1548},{"style":304},[1549],{"type":38,"value":1550},"(inventory);\n",{"type":21,"tag":291,"props":1552,"children":1553},{"class":293,"line":336},[1554,1559,1564],{"type":21,"tag":291,"props":1555,"children":1556},{"style":304},[1557],{"type":38,"value":1558},"console.",{"type":21,"tag":291,"props":1560,"children":1561},{"style":421},[1562],{"type":38,"value":1563},"log",{"type":21,"tag":291,"props":1565,"children":1566},{"style":304},[1567],{"type":38,"value":1568},"(parsedInventory);\n",{"type":21,"tag":22,"props":1570,"children":1571},{},[1572],{"type":38,"value":1573},"We will see an array of items that look like this:",{"type":21,"tag":108,"props":1575,"children":1577},{"code":1576,"language":284,"meta":7,"className":285,"style":7},"{\n    appid: 730,\n    classid: '720381639',\n    instanceid: '5837227973',\n    assetid: '38537743650',\n    contextid: '2',\n    icon_url: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf2PLacDBA5ciJlZG0hOPxNrfunWVY7sBOguzA45W73wy2_BY4Nm32cIWQcA4_ZVCC_1K4kLvohJTt7s6YmnRqs3Yh5y7Zlgv330_d1jhnvw',\n    tradable: 1,\n    inspect_url: 'steam:\u002F\u002Frungame\u002F730\u002F76561202255233023\u002F+csgo_econ_action_preview%20S%owner_steamid%A%assetid%D9223627464362234909',\n    name: '★ Karambit | Rust Coat',\n    market_hash_name: '★ Karambit | Rust Coat (Battle-Scarred)',\n    name_color: '8650AC'\n}\n",[1578],{"type":21,"tag":66,"props":1579,"children":1580},{"__ignoreMap":7},[1581,1589,1611,1632,1653,1674,1695,1716,1737,1758,1779,1800,1817],{"type":21,"tag":291,"props":1582,"children":1583},{"class":293,"line":294},[1584],{"type":21,"tag":291,"props":1585,"children":1586},{"style":304},[1587],{"type":38,"value":1588},"{\n",{"type":21,"tag":291,"props":1590,"children":1591},{"class":293,"line":326},[1592,1597,1602,1607],{"type":21,"tag":291,"props":1593,"children":1594},{"style":421},[1595],{"type":38,"value":1596},"    appid",{"type":21,"tag":291,"props":1598,"children":1599},{"style":304},[1600],{"type":38,"value":1601},": ",{"type":21,"tag":291,"props":1603,"children":1604},{"style":345},[1605],{"type":38,"value":1606},"730",{"type":21,"tag":291,"props":1608,"children":1609},{"style":304},[1610],{"type":38,"value":1403},{"type":21,"tag":291,"props":1612,"children":1613},{"class":293,"line":336},[1614,1619,1623,1628],{"type":21,"tag":291,"props":1615,"children":1616},{"style":421},[1617],{"type":38,"value":1618},"    classid",{"type":21,"tag":291,"props":1620,"children":1621},{"style":304},[1622],{"type":38,"value":1601},{"type":21,"tag":291,"props":1624,"children":1625},{"style":315},[1626],{"type":38,"value":1627},"'720381639'",{"type":21,"tag":291,"props":1629,"children":1630},{"style":304},[1631],{"type":38,"value":1403},{"type":21,"tag":291,"props":1633,"children":1634},{"class":293,"line":370},[1635,1640,1644,1649],{"type":21,"tag":291,"props":1636,"children":1637},{"style":421},[1638],{"type":38,"value":1639},"    instanceid",{"type":21,"tag":291,"props":1641,"children":1642},{"style":304},[1643],{"type":38,"value":1601},{"type":21,"tag":291,"props":1645,"children":1646},{"style":315},[1647],{"type":38,"value":1648},"'5837227973'",{"type":21,"tag":291,"props":1650,"children":1651},{"style":304},[1652],{"type":38,"value":1403},{"type":21,"tag":291,"props":1654,"children":1655},{"class":293,"line":378},[1656,1661,1665,1670],{"type":21,"tag":291,"props":1657,"children":1658},{"style":421},[1659],{"type":38,"value":1660},"    assetid",{"type":21,"tag":291,"props":1662,"children":1663},{"style":304},[1664],{"type":38,"value":1601},{"type":21,"tag":291,"props":1666,"children":1667},{"style":315},[1668],{"type":38,"value":1669},"'38537743650'",{"type":21,"tag":291,"props":1671,"children":1672},{"style":304},[1673],{"type":38,"value":1403},{"type":21,"tag":291,"props":1675,"children":1676},{"class":293,"line":407},[1677,1682,1686,1691],{"type":21,"tag":291,"props":1678,"children":1679},{"style":421},[1680],{"type":38,"value":1681},"    contextid",{"type":21,"tag":291,"props":1683,"children":1684},{"style":304},[1685],{"type":38,"value":1601},{"type":21,"tag":291,"props":1687,"children":1688},{"style":315},[1689],{"type":38,"value":1690},"'2'",{"type":21,"tag":291,"props":1692,"children":1693},{"style":304},[1694],{"type":38,"value":1403},{"type":21,"tag":291,"props":1696,"children":1697},{"class":293,"line":442},[1698,1703,1707,1712],{"type":21,"tag":291,"props":1699,"children":1700},{"style":421},[1701],{"type":38,"value":1702},"    icon_url",{"type":21,"tag":291,"props":1704,"children":1705},{"style":304},[1706],{"type":38,"value":1601},{"type":21,"tag":291,"props":1708,"children":1709},{"style":315},[1710],{"type":38,"value":1711},"'-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf2PLacDBA5ciJlZG0hOPxNrfunWVY7sBOguzA45W73wy2_BY4Nm32cIWQcA4_ZVCC_1K4kLvohJTt7s6YmnRqs3Yh5y7Zlgv330_d1jhnvw'",{"type":21,"tag":291,"props":1713,"children":1714},{"style":304},[1715],{"type":38,"value":1403},{"type":21,"tag":291,"props":1717,"children":1718},{"class":293,"line":451},[1719,1724,1728,1733],{"type":21,"tag":291,"props":1720,"children":1721},{"style":421},[1722],{"type":38,"value":1723},"    tradable",{"type":21,"tag":291,"props":1725,"children":1726},{"style":304},[1727],{"type":38,"value":1601},{"type":21,"tag":291,"props":1729,"children":1730},{"style":345},[1731],{"type":38,"value":1732},"1",{"type":21,"tag":291,"props":1734,"children":1735},{"style":304},[1736],{"type":38,"value":1403},{"type":21,"tag":291,"props":1738,"children":1739},{"class":293,"line":459},[1740,1745,1749,1754],{"type":21,"tag":291,"props":1741,"children":1742},{"style":421},[1743],{"type":38,"value":1744},"    inspect_url",{"type":21,"tag":291,"props":1746,"children":1747},{"style":304},[1748],{"type":38,"value":1601},{"type":21,"tag":291,"props":1750,"children":1751},{"style":315},[1752],{"type":38,"value":1753},"'steam:\u002F\u002Frungame\u002F730\u002F76561202255233023\u002F+csgo_econ_action_preview%20S%owner_steamid%A%assetid%D9223627464362234909'",{"type":21,"tag":291,"props":1755,"children":1756},{"style":304},[1757],{"type":38,"value":1403},{"type":21,"tag":291,"props":1759,"children":1760},{"class":293,"line":469},[1761,1766,1770,1775],{"type":21,"tag":291,"props":1762,"children":1763},{"style":421},[1764],{"type":38,"value":1765},"    name",{"type":21,"tag":291,"props":1767,"children":1768},{"style":304},[1769],{"type":38,"value":1601},{"type":21,"tag":291,"props":1771,"children":1772},{"style":315},[1773],{"type":38,"value":1774},"'★ Karambit | Rust Coat'",{"type":21,"tag":291,"props":1776,"children":1777},{"style":304},[1778],{"type":38,"value":1403},{"type":21,"tag":291,"props":1780,"children":1781},{"class":293,"line":478},[1782,1787,1791,1796],{"type":21,"tag":291,"props":1783,"children":1784},{"style":421},[1785],{"type":38,"value":1786},"    market_hash_name",{"type":21,"tag":291,"props":1788,"children":1789},{"style":304},[1790],{"type":38,"value":1601},{"type":21,"tag":291,"props":1792,"children":1793},{"style":315},[1794],{"type":38,"value":1795},"'★ Karambit | Rust Coat (Battle-Scarred)'",{"type":21,"tag":291,"props":1797,"children":1798},{"style":304},[1799],{"type":38,"value":1403},{"type":21,"tag":291,"props":1801,"children":1802},{"class":293,"line":487},[1803,1808,1812],{"type":21,"tag":291,"props":1804,"children":1805},{"style":421},[1806],{"type":38,"value":1807},"    name_color",{"type":21,"tag":291,"props":1809,"children":1810},{"style":304},[1811],{"type":38,"value":1601},{"type":21,"tag":291,"props":1813,"children":1814},{"style":315},[1815],{"type":38,"value":1816},"'8650AC'\n",{"type":21,"tag":291,"props":1818,"children":1819},{"class":293,"line":516},[1820],{"type":21,"tag":291,"props":1821,"children":1822},{"style":304},[1823],{"type":38,"value":448},{"type":21,"tag":22,"props":1825,"children":1826},{},[1827,1829,1835],{"type":38,"value":1828},"If we look at the inspect url, we can see that we are missing the S and A properties that I mentioned earlier, and that they are filled with ",{"type":21,"tag":66,"props":1830,"children":1832},{"className":1831},[],[1833],{"type":38,"value":1834},"%",{"type":38,"value":1836}," placeholders. On a positive note, at least they tell us precisely what should be put in their place.",{"type":21,"tag":270,"props":1838,"children":1840},{"id":1839},"populating-the-owner_steamid-and-assetid-fields",[1841],{"type":38,"value":1842},"Populating the %owner_steamid% and %assetid% fields",{"type":21,"tag":22,"props":1844,"children":1845},{},[1846],{"type":38,"value":1847},"The last step is to populate the fields in the item's inspect url, and actually fetch the floatvalue for each item in the parsed inventory.",{"type":21,"tag":108,"props":1849,"children":1851},{"code":1850,"language":284,"meta":7,"className":285,"style":7},"\u002F**\n * Populates the float values of the items in the inventory\n * @param {ParsedInventoryItem[]} parsedInventory\n * @param {steamid64} steamid64\n * @returns {Promise\u003CParsedInventoryItem[]>}\n *\u002F\nconst addFloatsToParsedInventory = async (parsedInventory, steamid64) => {\n    const parsedInventoryWithFloats = [];\n\n    for (const item of parsedInventory) {\n        try {\n            if (!item.inspect_url) {\n                console.error('No inspect url found for item:', item.market_hash_name);\n                continue;\n            }\n\n            const parsedInspectUrl = item.inspect_url\n              .replace('%owner_steamid%', steamid64)\n              .replace('%assetid%', item.assetid);\n\n            const response = await axios.get(\n                'https:\u002F\u002Fcsinventoryapi.com\u002Fapi\u002Fv1\u002Finspect?api_key=' + API_KEY + '&url=' + parsedInspectUrl\n            );\n\n            const {\n              floatvalue,\n              paintseed,\n              paintindex\n            } = response.data.iteminfo;\n\n            parsedInventoryWithFloats.push({\n                ...item,\n                inspect_url: parsedInspectUrl,\n                floatvalue,\n                paintseed,\n                paintindex\n            });\n\n            await new Promise(r => setTimeout(r, 10000));\n            console.log('Fetched float values for item:', item.market_hash_name);\n        } catch (error) {\n            console.log(error);\n            console.error('Failed to fetch float values for item:', item.market_hash_name);\n        }\n    }\n\n    return parsedInventoryWithFloats;\n}\n",[1852],{"type":21,"tag":66,"props":1853,"children":1854},{"__ignoreMap":7},[1855,1862,1870,1891,1912,1927,1934,1984,2004,2011,2041,2053,2074,2101,2113,2121,2128,2150,2177,2202,2209,2240,2275,2283,2290,2301,2313,2325,2333,2350,2357,2373,2386,2394,2403,2412,2421,2430,2438,2489,2515,2534,2551,2576,2584,2592,2600,2613],{"type":21,"tag":291,"props":1856,"children":1857},{"class":293,"line":294},[1858],{"type":21,"tag":291,"props":1859,"children":1860},{"style":463},[1861],{"type":38,"value":466},{"type":21,"tag":291,"props":1863,"children":1864},{"class":293,"line":326},[1865],{"type":21,"tag":291,"props":1866,"children":1867},{"style":463},[1868],{"type":38,"value":1869}," * Populates the float values of the items in the inventory\n",{"type":21,"tag":291,"props":1871,"children":1872},{"class":293,"line":336},[1873,1877,1881,1886],{"type":21,"tag":291,"props":1874,"children":1875},{"style":463},[1876],{"type":38,"value":493},{"type":21,"tag":291,"props":1878,"children":1879},{"style":298},[1880],{"type":38,"value":498},{"type":21,"tag":291,"props":1882,"children":1883},{"style":421},[1884],{"type":38,"value":1885}," {ParsedInventoryItem[]}",{"type":21,"tag":291,"props":1887,"children":1888},{"style":304},[1889],{"type":38,"value":1890}," parsedInventory\n",{"type":21,"tag":291,"props":1892,"children":1893},{"class":293,"line":370},[1894,1898,1902,1907],{"type":21,"tag":291,"props":1895,"children":1896},{"style":463},[1897],{"type":38,"value":493},{"type":21,"tag":291,"props":1899,"children":1900},{"style":298},[1901],{"type":38,"value":498},{"type":21,"tag":291,"props":1903,"children":1904},{"style":421},[1905],{"type":38,"value":1906}," {steamid64}",{"type":21,"tag":291,"props":1908,"children":1909},{"style":304},[1910],{"type":38,"value":1911}," steamid64\n",{"type":21,"tag":291,"props":1913,"children":1914},{"class":293,"line":378},[1915,1919,1923],{"type":21,"tag":291,"props":1916,"children":1917},{"style":463},[1918],{"type":38,"value":493},{"type":21,"tag":291,"props":1920,"children":1921},{"style":298},[1922],{"type":38,"value":526},{"type":21,"tag":291,"props":1924,"children":1925},{"style":421},[1926],{"type":38,"value":998},{"type":21,"tag":291,"props":1928,"children":1929},{"class":293,"line":407},[1930],{"type":21,"tag":291,"props":1931,"children":1932},{"style":463},[1933],{"type":38,"value":545},{"type":21,"tag":291,"props":1935,"children":1936},{"class":293,"line":442},[1937,1941,1946,1950,1954,1958,1963,1968,1972,1976,1980],{"type":21,"tag":291,"props":1938,"children":1939},{"style":298},[1940],{"type":38,"value":342},{"type":21,"tag":291,"props":1942,"children":1943},{"style":421},[1944],{"type":38,"value":1945}," addFloatsToParsedInventory",{"type":21,"tag":291,"props":1947,"children":1948},{"style":298},[1949],{"type":38,"value":353},{"type":21,"tag":291,"props":1951,"children":1952},{"style":298},[1953],{"type":38,"value":567},{"type":21,"tag":291,"props":1955,"children":1956},{"style":304},[1957],{"type":38,"value":389},{"type":21,"tag":291,"props":1959,"children":1960},{"style":574},[1961],{"type":38,"value":1962},"parsedInventory",{"type":21,"tag":291,"props":1964,"children":1965},{"style":304},[1966],{"type":38,"value":1967},", ",{"type":21,"tag":291,"props":1969,"children":1970},{"style":574},[1971],{"type":38,"value":577},{"type":21,"tag":291,"props":1973,"children":1974},{"style":304},[1975],{"type":38,"value":582},{"type":21,"tag":291,"props":1977,"children":1978},{"style":298},[1979],{"type":38,"value":587},{"type":21,"tag":291,"props":1981,"children":1982},{"style":304},[1983],{"type":38,"value":592},{"type":21,"tag":291,"props":1985,"children":1986},{"class":293,"line":451},[1987,1991,1996,2000],{"type":21,"tag":291,"props":1988,"children":1989},{"style":298},[1990],{"type":38,"value":601},{"type":21,"tag":291,"props":1992,"children":1993},{"style":345},[1994],{"type":38,"value":1995}," parsedInventoryWithFloats",{"type":21,"tag":291,"props":1997,"children":1998},{"style":298},[1999],{"type":38,"value":353},{"type":21,"tag":291,"props":2001,"children":2002},{"style":304},[2003],{"type":38,"value":1067},{"type":21,"tag":291,"props":2005,"children":2006},{"class":293,"line":459},[2007],{"type":21,"tag":291,"props":2008,"children":2009},{"emptyLinePlaceholder":330},[2010],{"type":38,"value":333},{"type":21,"tag":291,"props":2012,"children":2013},{"class":293,"line":469},[2014,2018,2022,2026,2031,2036],{"type":21,"tag":291,"props":2015,"children":2016},{"style":298},[2017],{"type":38,"value":1082},{"type":21,"tag":291,"props":2019,"children":2020},{"style":304},[2021],{"type":38,"value":389},{"type":21,"tag":291,"props":2023,"children":2024},{"style":298},[2025],{"type":38,"value":342},{"type":21,"tag":291,"props":2027,"children":2028},{"style":345},[2029],{"type":38,"value":2030}," item",{"type":21,"tag":291,"props":2032,"children":2033},{"style":298},[2034],{"type":38,"value":2035}," of",{"type":21,"tag":291,"props":2037,"children":2038},{"style":304},[2039],{"type":38,"value":2040}," parsedInventory) {\n",{"type":21,"tag":291,"props":2042,"children":2043},{"class":293,"line":478},[2044,2049],{"type":21,"tag":291,"props":2045,"children":2046},{"style":298},[2047],{"type":38,"value":2048},"        try",{"type":21,"tag":291,"props":2050,"children":2051},{"style":304},[2052],{"type":38,"value":592},{"type":21,"tag":291,"props":2054,"children":2055},{"class":293,"line":487},[2056,2061,2065,2069],{"type":21,"tag":291,"props":2057,"children":2058},{"style":298},[2059],{"type":38,"value":2060},"            if",{"type":21,"tag":291,"props":2062,"children":2063},{"style":304},[2064],{"type":38,"value":389},{"type":21,"tag":291,"props":2066,"children":2067},{"style":298},[2068],{"type":38,"value":394},{"type":21,"tag":291,"props":2070,"children":2071},{"style":304},[2072],{"type":38,"value":2073},"item.inspect_url) {\n",{"type":21,"tag":291,"props":2075,"children":2076},{"class":293,"line":516},[2077,2082,2087,2091,2096],{"type":21,"tag":291,"props":2078,"children":2079},{"style":304},[2080],{"type":38,"value":2081},"                console.",{"type":21,"tag":291,"props":2083,"children":2084},{"style":421},[2085],{"type":38,"value":2086},"error",{"type":21,"tag":291,"props":2088,"children":2089},{"style":304},[2090],{"type":38,"value":429},{"type":21,"tag":291,"props":2092,"children":2093},{"style":315},[2094],{"type":38,"value":2095},"'No inspect url found for item:'",{"type":21,"tag":291,"props":2097,"children":2098},{"style":304},[2099],{"type":38,"value":2100},", item.market_hash_name);\n",{"type":21,"tag":291,"props":2102,"children":2103},{"class":293,"line":539},[2104,2109],{"type":21,"tag":291,"props":2105,"children":2106},{"style":298},[2107],{"type":38,"value":2108},"                continue",{"type":21,"tag":291,"props":2110,"children":2111},{"style":304},[2112],{"type":38,"value":323},{"type":21,"tag":291,"props":2114,"children":2115},{"class":293,"line":548},[2116],{"type":21,"tag":291,"props":2117,"children":2118},{"style":304},[2119],{"type":38,"value":2120},"            }\n",{"type":21,"tag":291,"props":2122,"children":2123},{"class":293,"line":595},[2124],{"type":21,"tag":291,"props":2125,"children":2126},{"emptyLinePlaceholder":330},[2127],{"type":38,"value":333},{"type":21,"tag":291,"props":2129,"children":2130},{"class":293,"line":633},[2131,2136,2141,2145],{"type":21,"tag":291,"props":2132,"children":2133},{"style":298},[2134],{"type":38,"value":2135},"            const",{"type":21,"tag":291,"props":2137,"children":2138},{"style":345},[2139],{"type":38,"value":2140}," parsedInspectUrl",{"type":21,"tag":291,"props":2142,"children":2143},{"style":298},[2144],{"type":38,"value":353},{"type":21,"tag":291,"props":2146,"children":2147},{"style":304},[2148],{"type":38,"value":2149}," item.inspect_url\n",{"type":21,"tag":291,"props":2151,"children":2152},{"class":293,"line":660},[2153,2158,2163,2167,2172],{"type":21,"tag":291,"props":2154,"children":2155},{"style":304},[2156],{"type":38,"value":2157},"              .",{"type":21,"tag":291,"props":2159,"children":2160},{"style":421},[2161],{"type":38,"value":2162},"replace",{"type":21,"tag":291,"props":2164,"children":2165},{"style":304},[2166],{"type":38,"value":429},{"type":21,"tag":291,"props":2168,"children":2169},{"style":315},[2170],{"type":38,"value":2171},"'%owner_steamid%'",{"type":21,"tag":291,"props":2173,"children":2174},{"style":304},[2175],{"type":38,"value":2176},", steamid64)\n",{"type":21,"tag":291,"props":2178,"children":2179},{"class":293,"line":669},[2180,2184,2188,2192,2197],{"type":21,"tag":291,"props":2181,"children":2182},{"style":304},[2183],{"type":38,"value":2157},{"type":21,"tag":291,"props":2185,"children":2186},{"style":421},[2187],{"type":38,"value":2162},{"type":21,"tag":291,"props":2189,"children":2190},{"style":304},[2191],{"type":38,"value":429},{"type":21,"tag":291,"props":2193,"children":2194},{"style":315},[2195],{"type":38,"value":2196},"'%assetid%'",{"type":21,"tag":291,"props":2198,"children":2199},{"style":304},[2200],{"type":38,"value":2201},", item.assetid);\n",{"type":21,"tag":291,"props":2203,"children":2204},{"class":293,"line":677},[2205],{"type":21,"tag":291,"props":2206,"children":2207},{"emptyLinePlaceholder":330},[2208],{"type":38,"value":333},{"type":21,"tag":291,"props":2210,"children":2211},{"class":293,"line":705},[2212,2216,2220,2224,2228,2232,2236],{"type":21,"tag":291,"props":2213,"children":2214},{"style":298},[2215],{"type":38,"value":2135},{"type":21,"tag":291,"props":2217,"children":2218},{"style":345},[2219],{"type":38,"value":606},{"type":21,"tag":291,"props":2221,"children":2222},{"style":298},[2223],{"type":38,"value":353},{"type":21,"tag":291,"props":2225,"children":2226},{"style":298},[2227],{"type":38,"value":615},{"type":21,"tag":291,"props":2229,"children":2230},{"style":304},[2231],{"type":38,"value":620},{"type":21,"tag":291,"props":2233,"children":2234},{"style":421},[2235],{"type":38,"value":625},{"type":21,"tag":291,"props":2237,"children":2238},{"style":304},[2239],{"type":38,"value":630},{"type":21,"tag":291,"props":2241,"children":2242},{"class":293,"line":735},[2243,2248,2253,2257,2261,2266,2270],{"type":21,"tag":291,"props":2244,"children":2245},{"style":315},[2246],{"type":38,"value":2247},"                'https:\u002F\u002Fcsinventoryapi.com\u002Fapi\u002Fv1\u002Finspect?api_key='",{"type":21,"tag":291,"props":2249,"children":2250},{"style":298},[2251],{"type":38,"value":2252}," +",{"type":21,"tag":291,"props":2254,"children":2255},{"style":345},[2256],{"type":38,"value":348},{"type":21,"tag":291,"props":2258,"children":2259},{"style":298},[2260],{"type":38,"value":2252},{"type":21,"tag":291,"props":2262,"children":2263},{"style":315},[2264],{"type":38,"value":2265}," '&url='",{"type":21,"tag":291,"props":2267,"children":2268},{"style":298},[2269],{"type":38,"value":2252},{"type":21,"tag":291,"props":2271,"children":2272},{"style":304},[2273],{"type":38,"value":2274}," parsedInspectUrl\n",{"type":21,"tag":291,"props":2276,"children":2277},{"class":293,"line":744},[2278],{"type":21,"tag":291,"props":2279,"children":2280},{"style":304},[2281],{"type":38,"value":2282},"            );\n",{"type":21,"tag":291,"props":2284,"children":2285},{"class":293,"line":752},[2286],{"type":21,"tag":291,"props":2287,"children":2288},{"emptyLinePlaceholder":330},[2289],{"type":38,"value":333},{"type":21,"tag":291,"props":2291,"children":2292},{"class":293,"line":779},[2293,2297],{"type":21,"tag":291,"props":2294,"children":2295},{"style":298},[2296],{"type":38,"value":2135},{"type":21,"tag":291,"props":2298,"children":2299},{"style":304},[2300],{"type":38,"value":592},{"type":21,"tag":291,"props":2302,"children":2303},{"class":293,"line":808},[2304,2309],{"type":21,"tag":291,"props":2305,"children":2306},{"style":345},[2307],{"type":38,"value":2308},"              floatvalue",{"type":21,"tag":291,"props":2310,"children":2311},{"style":304},[2312],{"type":38,"value":1403},{"type":21,"tag":291,"props":2314,"children":2315},{"class":293,"line":816},[2316,2321],{"type":21,"tag":291,"props":2317,"children":2318},{"style":345},[2319],{"type":38,"value":2320},"              paintseed",{"type":21,"tag":291,"props":2322,"children":2323},{"style":304},[2324],{"type":38,"value":1403},{"type":21,"tag":291,"props":2326,"children":2327},{"class":293,"line":824},[2328],{"type":21,"tag":291,"props":2329,"children":2330},{"style":345},[2331],{"type":38,"value":2332},"              paintindex\n",{"type":21,"tag":291,"props":2334,"children":2335},{"class":293,"line":860},[2336,2341,2345],{"type":21,"tag":291,"props":2337,"children":2338},{"style":304},[2339],{"type":38,"value":2340},"            } ",{"type":21,"tag":291,"props":2342,"children":2343},{"style":298},[2344],{"type":38,"value":1101},{"type":21,"tag":291,"props":2346,"children":2347},{"style":304},[2348],{"type":38,"value":2349}," response.data.iteminfo;\n",{"type":21,"tag":291,"props":2351,"children":2352},{"class":293,"line":889},[2353],{"type":21,"tag":291,"props":2354,"children":2355},{"emptyLinePlaceholder":330},[2356],{"type":38,"value":333},{"type":21,"tag":291,"props":2358,"children":2359},{"class":293,"line":897},[2360,2365,2369],{"type":21,"tag":291,"props":2361,"children":2362},{"style":304},[2363],{"type":38,"value":2364},"            parsedInventoryWithFloats.",{"type":21,"tag":291,"props":2366,"children":2367},{"style":421},[2368],{"type":38,"value":1283},{"type":21,"tag":291,"props":2370,"children":2371},{"style":304},[2372],{"type":38,"value":1288},{"type":21,"tag":291,"props":2374,"children":2375},{"class":293,"line":905},[2376,2381],{"type":21,"tag":291,"props":2377,"children":2378},{"style":298},[2379],{"type":38,"value":2380},"                ...",{"type":21,"tag":291,"props":2382,"children":2383},{"style":304},[2384],{"type":38,"value":2385},"item,\n",{"type":21,"tag":291,"props":2387,"children":2388},{"class":293,"line":919},[2389],{"type":21,"tag":291,"props":2390,"children":2391},{"style":304},[2392],{"type":38,"value":2393},"                inspect_url: parsedInspectUrl,\n",{"type":21,"tag":291,"props":2395,"children":2397},{"class":293,"line":2396},34,[2398],{"type":21,"tag":291,"props":2399,"children":2400},{"style":304},[2401],{"type":38,"value":2402},"                floatvalue,\n",{"type":21,"tag":291,"props":2404,"children":2406},{"class":293,"line":2405},35,[2407],{"type":21,"tag":291,"props":2408,"children":2409},{"style":304},[2410],{"type":38,"value":2411},"                paintseed,\n",{"type":21,"tag":291,"props":2413,"children":2415},{"class":293,"line":2414},36,[2416],{"type":21,"tag":291,"props":2417,"children":2418},{"style":304},[2419],{"type":38,"value":2420},"                paintindex\n",{"type":21,"tag":291,"props":2422,"children":2424},{"class":293,"line":2423},37,[2425],{"type":21,"tag":291,"props":2426,"children":2427},{"style":304},[2428],{"type":38,"value":2429},"            });\n",{"type":21,"tag":291,"props":2431,"children":2433},{"class":293,"line":2432},38,[2434],{"type":21,"tag":291,"props":2435,"children":2436},{"emptyLinePlaceholder":330},[2437],{"type":38,"value":333},{"type":21,"tag":291,"props":2439,"children":2441},{"class":293,"line":2440},39,[2442,2447,2451,2456,2460,2465,2469,2474,2479,2484],{"type":21,"tag":291,"props":2443,"children":2444},{"style":298},[2445],{"type":38,"value":2446},"            await",{"type":21,"tag":291,"props":2448,"children":2449},{"style":298},[2450],{"type":38,"value":418},{"type":21,"tag":291,"props":2452,"children":2453},{"style":345},[2454],{"type":38,"value":2455}," Promise",{"type":21,"tag":291,"props":2457,"children":2458},{"style":304},[2459],{"type":38,"value":429},{"type":21,"tag":291,"props":2461,"children":2462},{"style":574},[2463],{"type":38,"value":2464},"r",{"type":21,"tag":291,"props":2466,"children":2467},{"style":298},[2468],{"type":38,"value":1201},{"type":21,"tag":291,"props":2470,"children":2471},{"style":421},[2472],{"type":38,"value":2473}," setTimeout",{"type":21,"tag":291,"props":2475,"children":2476},{"style":304},[2477],{"type":38,"value":2478},"(r, ",{"type":21,"tag":291,"props":2480,"children":2481},{"style":345},[2482],{"type":38,"value":2483},"10000",{"type":21,"tag":291,"props":2485,"children":2486},{"style":304},[2487],{"type":38,"value":2488},"));\n",{"type":21,"tag":291,"props":2490,"children":2492},{"class":293,"line":2491},40,[2493,2498,2502,2506,2511],{"type":21,"tag":291,"props":2494,"children":2495},{"style":304},[2496],{"type":38,"value":2497},"            console.",{"type":21,"tag":291,"props":2499,"children":2500},{"style":421},[2501],{"type":38,"value":1563},{"type":21,"tag":291,"props":2503,"children":2504},{"style":304},[2505],{"type":38,"value":429},{"type":21,"tag":291,"props":2507,"children":2508},{"style":315},[2509],{"type":38,"value":2510},"'Fetched float values for item:'",{"type":21,"tag":291,"props":2512,"children":2513},{"style":304},[2514],{"type":38,"value":2100},{"type":21,"tag":291,"props":2516,"children":2518},{"class":293,"line":2517},41,[2519,2524,2529],{"type":21,"tag":291,"props":2520,"children":2521},{"style":304},[2522],{"type":38,"value":2523},"        } ",{"type":21,"tag":291,"props":2525,"children":2526},{"style":298},[2527],{"type":38,"value":2528},"catch",{"type":21,"tag":291,"props":2530,"children":2531},{"style":304},[2532],{"type":38,"value":2533}," (error) {\n",{"type":21,"tag":291,"props":2535,"children":2537},{"class":293,"line":2536},42,[2538,2542,2546],{"type":21,"tag":291,"props":2539,"children":2540},{"style":304},[2541],{"type":38,"value":2497},{"type":21,"tag":291,"props":2543,"children":2544},{"style":421},[2545],{"type":38,"value":1563},{"type":21,"tag":291,"props":2547,"children":2548},{"style":304},[2549],{"type":38,"value":2550},"(error);\n",{"type":21,"tag":291,"props":2552,"children":2554},{"class":293,"line":2553},43,[2555,2559,2563,2567,2572],{"type":21,"tag":291,"props":2556,"children":2557},{"style":304},[2558],{"type":38,"value":2497},{"type":21,"tag":291,"props":2560,"children":2561},{"style":421},[2562],{"type":38,"value":2086},{"type":21,"tag":291,"props":2564,"children":2565},{"style":304},[2566],{"type":38,"value":429},{"type":21,"tag":291,"props":2568,"children":2569},{"style":315},[2570],{"type":38,"value":2571},"'Failed to fetch float values for item:'",{"type":21,"tag":291,"props":2573,"children":2574},{"style":304},[2575],{"type":38,"value":2100},{"type":21,"tag":291,"props":2577,"children":2579},{"class":293,"line":2578},44,[2580],{"type":21,"tag":291,"props":2581,"children":2582},{"style":304},[2583],{"type":38,"value":1263},{"type":21,"tag":291,"props":2585,"children":2587},{"class":293,"line":2586},45,[2588],{"type":21,"tag":291,"props":2589,"children":2590},{"style":304},[2591],{"type":38,"value":741},{"type":21,"tag":291,"props":2593,"children":2595},{"class":293,"line":2594},46,[2596],{"type":21,"tag":291,"props":2597,"children":2598},{"emptyLinePlaceholder":330},[2599],{"type":38,"value":333},{"type":21,"tag":291,"props":2601,"children":2603},{"class":293,"line":2602},47,[2604,2608],{"type":21,"tag":291,"props":2605,"children":2606},{"style":298},[2607],{"type":38,"value":911},{"type":21,"tag":291,"props":2609,"children":2610},{"style":304},[2611],{"type":38,"value":2612}," parsedInventoryWithFloats;\n",{"type":21,"tag":291,"props":2614,"children":2616},{"class":293,"line":2615},48,[2617],{"type":21,"tag":291,"props":2618,"children":2619},{"style":304},[2620],{"type":38,"value":448},{"type":21,"tag":22,"props":2622,"children":2623},{},[2624,2626,2631],{"type":38,"value":2625},"First we replace the missing fields in the ",{"type":21,"tag":66,"props":2627,"children":2629},{"className":2628},[],[2630],{"type":38,"value":1479},{"type":38,"value":2632},", then we fetch the floatvalue using the API endpoint.",{"type":21,"tag":22,"props":2634,"children":2635},{},[2636],{"type":38,"value":2637},"If we run this and print the inventory afterwards, we'll see floatvalues for the items that have that property, e.g.:",{"type":21,"tag":108,"props":2639,"children":2641},{"code":2640,"language":284,"meta":7,"className":285,"style":7},"{\n    appid: 730,\n    classid: '1310017306',\n    instanceid: '5844343608',\n    assetid: '28124449669',\n    contextid: '2',\n    icon_url: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpoo6m1FBRp3_bGcjhQ09-jq5WYh8j_OrfdqWhe5sN4mOTE8bP5gVO8v106NT37LY-cJAZvZF-ErAC7wLi60MO57s7NwSBgvSgksynamEfmiRBJcKUx0nUflmj0',\n    tradable: 1,\n    inspect_url: 'steam:\u002F\u002Frungame\u002F730\u002F76561202255233023\u002F+csgo_econ_action_preview%20S76561198166295458A28124449669D17212839835523578275',\n    name: 'USP-S | Kill Confirmed',\n    market_hash_name: 'USP-S | Kill Confirmed (Minimal Wear)',\n    name_color: 'D2D2D2',\n    floatvalue: 0.13473990559577942,\n    paintseed: 461,\n    paintindex: 504\n}\n",[2642],{"type":21,"tag":66,"props":2643,"children":2644},{"__ignoreMap":7},[2645,2652,2671,2691,2711,2731,2750,2770,2789,2809,2829,2849,2869,2890,2911,2928],{"type":21,"tag":291,"props":2646,"children":2647},{"class":293,"line":294},[2648],{"type":21,"tag":291,"props":2649,"children":2650},{"style":304},[2651],{"type":38,"value":1588},{"type":21,"tag":291,"props":2653,"children":2654},{"class":293,"line":326},[2655,2659,2663,2667],{"type":21,"tag":291,"props":2656,"children":2657},{"style":421},[2658],{"type":38,"value":1596},{"type":21,"tag":291,"props":2660,"children":2661},{"style":304},[2662],{"type":38,"value":1601},{"type":21,"tag":291,"props":2664,"children":2665},{"style":345},[2666],{"type":38,"value":1606},{"type":21,"tag":291,"props":2668,"children":2669},{"style":304},[2670],{"type":38,"value":1403},{"type":21,"tag":291,"props":2672,"children":2673},{"class":293,"line":336},[2674,2678,2682,2687],{"type":21,"tag":291,"props":2675,"children":2676},{"style":421},[2677],{"type":38,"value":1618},{"type":21,"tag":291,"props":2679,"children":2680},{"style":304},[2681],{"type":38,"value":1601},{"type":21,"tag":291,"props":2683,"children":2684},{"style":315},[2685],{"type":38,"value":2686},"'1310017306'",{"type":21,"tag":291,"props":2688,"children":2689},{"style":304},[2690],{"type":38,"value":1403},{"type":21,"tag":291,"props":2692,"children":2693},{"class":293,"line":370},[2694,2698,2702,2707],{"type":21,"tag":291,"props":2695,"children":2696},{"style":421},[2697],{"type":38,"value":1639},{"type":21,"tag":291,"props":2699,"children":2700},{"style":304},[2701],{"type":38,"value":1601},{"type":21,"tag":291,"props":2703,"children":2704},{"style":315},[2705],{"type":38,"value":2706},"'5844343608'",{"type":21,"tag":291,"props":2708,"children":2709},{"style":304},[2710],{"type":38,"value":1403},{"type":21,"tag":291,"props":2712,"children":2713},{"class":293,"line":378},[2714,2718,2722,2727],{"type":21,"tag":291,"props":2715,"children":2716},{"style":421},[2717],{"type":38,"value":1660},{"type":21,"tag":291,"props":2719,"children":2720},{"style":304},[2721],{"type":38,"value":1601},{"type":21,"tag":291,"props":2723,"children":2724},{"style":315},[2725],{"type":38,"value":2726},"'28124449669'",{"type":21,"tag":291,"props":2728,"children":2729},{"style":304},[2730],{"type":38,"value":1403},{"type":21,"tag":291,"props":2732,"children":2733},{"class":293,"line":407},[2734,2738,2742,2746],{"type":21,"tag":291,"props":2735,"children":2736},{"style":421},[2737],{"type":38,"value":1681},{"type":21,"tag":291,"props":2739,"children":2740},{"style":304},[2741],{"type":38,"value":1601},{"type":21,"tag":291,"props":2743,"children":2744},{"style":315},[2745],{"type":38,"value":1690},{"type":21,"tag":291,"props":2747,"children":2748},{"style":304},[2749],{"type":38,"value":1403},{"type":21,"tag":291,"props":2751,"children":2752},{"class":293,"line":442},[2753,2757,2761,2766],{"type":21,"tag":291,"props":2754,"children":2755},{"style":421},[2756],{"type":38,"value":1702},{"type":21,"tag":291,"props":2758,"children":2759},{"style":304},[2760],{"type":38,"value":1601},{"type":21,"tag":291,"props":2762,"children":2763},{"style":315},[2764],{"type":38,"value":2765},"'-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpoo6m1FBRp3_bGcjhQ09-jq5WYh8j_OrfdqWhe5sN4mOTE8bP5gVO8v106NT37LY-cJAZvZF-ErAC7wLi60MO57s7NwSBgvSgksynamEfmiRBJcKUx0nUflmj0'",{"type":21,"tag":291,"props":2767,"children":2768},{"style":304},[2769],{"type":38,"value":1403},{"type":21,"tag":291,"props":2771,"children":2772},{"class":293,"line":451},[2773,2777,2781,2785],{"type":21,"tag":291,"props":2774,"children":2775},{"style":421},[2776],{"type":38,"value":1723},{"type":21,"tag":291,"props":2778,"children":2779},{"style":304},[2780],{"type":38,"value":1601},{"type":21,"tag":291,"props":2782,"children":2783},{"style":345},[2784],{"type":38,"value":1732},{"type":21,"tag":291,"props":2786,"children":2787},{"style":304},[2788],{"type":38,"value":1403},{"type":21,"tag":291,"props":2790,"children":2791},{"class":293,"line":459},[2792,2796,2800,2805],{"type":21,"tag":291,"props":2793,"children":2794},{"style":421},[2795],{"type":38,"value":1744},{"type":21,"tag":291,"props":2797,"children":2798},{"style":304},[2799],{"type":38,"value":1601},{"type":21,"tag":291,"props":2801,"children":2802},{"style":315},[2803],{"type":38,"value":2804},"'steam:\u002F\u002Frungame\u002F730\u002F76561202255233023\u002F+csgo_econ_action_preview%20S76561198166295458A28124449669D17212839835523578275'",{"type":21,"tag":291,"props":2806,"children":2807},{"style":304},[2808],{"type":38,"value":1403},{"type":21,"tag":291,"props":2810,"children":2811},{"class":293,"line":469},[2812,2816,2820,2825],{"type":21,"tag":291,"props":2813,"children":2814},{"style":421},[2815],{"type":38,"value":1765},{"type":21,"tag":291,"props":2817,"children":2818},{"style":304},[2819],{"type":38,"value":1601},{"type":21,"tag":291,"props":2821,"children":2822},{"style":315},[2823],{"type":38,"value":2824},"'USP-S | Kill Confirmed'",{"type":21,"tag":291,"props":2826,"children":2827},{"style":304},[2828],{"type":38,"value":1403},{"type":21,"tag":291,"props":2830,"children":2831},{"class":293,"line":478},[2832,2836,2840,2845],{"type":21,"tag":291,"props":2833,"children":2834},{"style":421},[2835],{"type":38,"value":1786},{"type":21,"tag":291,"props":2837,"children":2838},{"style":304},[2839],{"type":38,"value":1601},{"type":21,"tag":291,"props":2841,"children":2842},{"style":315},[2843],{"type":38,"value":2844},"'USP-S | Kill Confirmed (Minimal Wear)'",{"type":21,"tag":291,"props":2846,"children":2847},{"style":304},[2848],{"type":38,"value":1403},{"type":21,"tag":291,"props":2850,"children":2851},{"class":293,"line":487},[2852,2856,2860,2865],{"type":21,"tag":291,"props":2853,"children":2854},{"style":421},[2855],{"type":38,"value":1807},{"type":21,"tag":291,"props":2857,"children":2858},{"style":304},[2859],{"type":38,"value":1601},{"type":21,"tag":291,"props":2861,"children":2862},{"style":315},[2863],{"type":38,"value":2864},"'D2D2D2'",{"type":21,"tag":291,"props":2866,"children":2867},{"style":304},[2868],{"type":38,"value":1403},{"type":21,"tag":291,"props":2870,"children":2871},{"class":293,"line":516},[2872,2877,2881,2886],{"type":21,"tag":291,"props":2873,"children":2874},{"style":421},[2875],{"type":38,"value":2876},"    floatvalue",{"type":21,"tag":291,"props":2878,"children":2879},{"style":304},[2880],{"type":38,"value":1601},{"type":21,"tag":291,"props":2882,"children":2883},{"style":345},[2884],{"type":38,"value":2885},"0.13473990559577942",{"type":21,"tag":291,"props":2887,"children":2888},{"style":304},[2889],{"type":38,"value":1403},{"type":21,"tag":291,"props":2891,"children":2892},{"class":293,"line":539},[2893,2898,2902,2907],{"type":21,"tag":291,"props":2894,"children":2895},{"style":421},[2896],{"type":38,"value":2897},"    paintseed",{"type":21,"tag":291,"props":2899,"children":2900},{"style":304},[2901],{"type":38,"value":1601},{"type":21,"tag":291,"props":2903,"children":2904},{"style":345},[2905],{"type":38,"value":2906},"461",{"type":21,"tag":291,"props":2908,"children":2909},{"style":304},[2910],{"type":38,"value":1403},{"type":21,"tag":291,"props":2912,"children":2913},{"class":293,"line":548},[2914,2919,2923],{"type":21,"tag":291,"props":2915,"children":2916},{"style":421},[2917],{"type":38,"value":2918},"    paintindex",{"type":21,"tag":291,"props":2920,"children":2921},{"style":304},[2922],{"type":38,"value":1601},{"type":21,"tag":291,"props":2924,"children":2925},{"style":345},[2926],{"type":38,"value":2927},"504\n",{"type":21,"tag":291,"props":2929,"children":2930},{"class":293,"line":595},[2931],{"type":21,"tag":291,"props":2932,"children":2933},{"style":304},[2934],{"type":38,"value":448},{"type":21,"tag":75,"props":2936,"children":2938},{"id":2937},"a-note-on-rate-limits",[2939],{"type":38,"value":2940},"A note on rate limits",{"type":21,"tag":22,"props":2942,"children":2943},{},[2944],{"type":38,"value":2945},"The timeout in the loop is to make sure that you do not hit the rate limit imposed by CSInventoryAPI. If you have a business\u002Fenterprise plan, the timeout duration can be adjusted accordingly.",{"type":21,"tag":22,"props":2947,"children":2948},{},[2949,2951,2957],{"type":38,"value":2950},"If you have any questions, want further help with implementation, or want to start a new project, feel free to ",{"type":21,"tag":43,"props":2952,"children":2954},{"href":2953},"\u002Fcontact",[2955],{"type":38,"value":2956},"get in touch",{"type":38,"value":202},{"type":21,"tag":2959,"props":2960,"children":2961},"style",{},[2962],{"type":38,"value":2963},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":326,"depth":326,"links":2965},[2966,2967,2968,2973],{"id":77,"depth":326,"text":80},{"id":186,"depth":326,"text":189},{"id":238,"depth":326,"text":241,"children":2969},[2970,2971,2972],{"id":272,"depth":336,"text":275},{"id":932,"depth":336,"text":935},{"id":1839,"depth":336,"text":1842},{"id":2937,"depth":326,"text":2940},"markdown","content:articles:cs2-inventory-with-floats-using-csinventoryapi-nodejs.md","content","articles\u002Fcs2-inventory-with-floats-using-csinventoryapi-nodejs.md","articles\u002Fcs2-inventory-with-floats-using-csinventoryapi-nodejs","md",1786464664068]