I haven't looked at tradeskills since before Legion so the changes added then and in BfA have changed that knowledge. But, they did have a way of getting that information but I can't locate it in the blizzard code at
https://www.townlong-yak.com/framexml/live/. You may want to see if another addon does something similar and see how theirs is doing it.