Looking up class restrictions

Is there a function in the API that will tell me if an item has a class restriction, and if so which classes can use it? So far I haven’t been able to find one. The item would not be in my possession so I can’t just get it from the tooltip, and I don’t just want to know if the current character can use it.

i dont think theres a direct API function for it, but you only need the item id or hyperlink to set a tooltip with, and then read the restrictions from there.

There must be something that essentially allows an addon to guess whether a class can unlock a transmog or not. Trove Tally filters to class and loot spec.

That’s not quite the same as class-specific unlock, but the end result is the same – whether a specific class can unlock an appearance.

Perhaps Trove Tally is accessing info about drop eligibility instead of appearance unlock eligibility, which makes it not a good example of solving the stated problem.

As best as I can tell from looking at the Trove Tally code, those decisions are based on info in the database that comes with the add-on. That’s the approach I’m currently taking as well, was hoping there was a better way.

PLH does it manually too.

a combination of tooltip scanning to pull the class out, a local table to tell what classes can wear what armor types, and the transmog api to tell if the current character can learn it or not.

havent checked the war within changes but its possible that the api returns false for a class specific item that isnt your class, in which case that would probably be enough on its own for your purpose?