korindou Posted September 19, 2020 Report Posted September 19, 2020 How do I check whether is item can be crafted or traded? The official WebAPI documentation says that items have optional fields flag_cannot_trade and flag_cannot_craft and if they're absent they're should be assumed false. Hovewer, in node-tf2 I'm not having these fields on all items, even those that aren't tradeable or craftable. Quote
Dr. McKay Posted September 22, 2020 Report Posted September 22, 2020 Unfortunately, the data received from the GC (what you get via node-tf2) is incredibly messy and there's like a dozen conditions you need to check to see whether an item is untradable/uncraftable. It's probably not worth your time doing and you should probably just pull that data from the web instead, but if you really want to, a starting point is that a few conditions that determine uncraftability is a flag in the flags field, an "achievement" origin, a "tradable after date" attribute, and a "never tradable" attribute. That's not an exhaustive list though. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.