NFT rarity: a deep dive

"How rare is my NFT?"

I recently spent some time with the Bunny Universe community, where this question came up a lot. Each Bunny is unique, but their traits (fur color, accessories, background, etc.) make some rarer than others.

Bunny Universe logo
ℹ️
I’m not affiliated with Bunny Universe and I’m not a founder of this ecosystem. However, I’m part of the community and I truly appreciate their work. Of course, this is not financial advice.

The challenge: measuring rarity

Every NFT has a unique ID, but what really makes one stand out from the rest? Traits.

Some traits are common, others are rare. Computing rarity means understanding how often each trait appears across a collection and assigning a score accordingly.

This led me to explore different tools and methods to compute NFT rarity.

Researching rarity scoring

I explored different platforms and wallets that provide rarity rankings:

  • MetaMask & OKX display rarity scores directly in their wallet interfaces.

  • This guide helped me understand different approaches.

  • I landed on OpenRarity, which is also used by OKX.

Computing rarity with OpenRarity

OpenRarity provides a Python library that:

  1. Fetches metadata from a collection.

  2. Analyzes traits to compute rarity scores.

You can check their full documentation here: OpenRarity docs.

Running the script

I’m not a Python developer, so I used Cursor to set up my environment and tweak the example script.

Here’s how the process worked:

  1. Fetch metadata: retrieve data for 2,500 NFTs from IPFS.

  2. Compute rarity scores: use OpenRarity’s algorithm.

  3. Generate a JSON file: store the results for easy use.

The whole process took about 10 minutes, mostly due to fetching metadata from IPFS.

Want to try it yourself?

I shared my script here.

Feel free to test it with any NFT collection and let me know what you find!

I’d love to hear how it works for you! 🚀

Running Bunny