Recycling facilities everywhere use tech like this (near infrared) at an industrial scale [0], and sorting robots that use AI is a rapidly growing industry [1]
I remember a few decades ago reading a documentary about PC cases shipped to facilities in southeast Asia where little kids would melt it with a lighter and smell the fumes to determine what type of plastic it was. Of course finding an article from the circa 2000 internet today is nigh impossible, but hopefully things have changed by now.