How to get CNFT rarity data?

Hello, everybody.
I am now wondering how we can get the CNFT’s rarity data in code.
As we can see in cnft.tools website, they certainly show the rarity of cnft trait and their prices.
Is there any api to fetch this data?

Thank you.