Seeking NFT Alpha with GoldRush
NFT Rarity
The rarity of an NFT (non-fungible token) is determined by its unique attributes and the scarcity of similar items. This typically includes factors such as:
wearable art pieces (attributes)
rare colors/features in the NFT (attributes)
if the combination of attributes rarely occurs in the collection (scarcity)
These attributes are tied to traits, which you can think of as the features of the NFT. For example, an NFT collection can consist of creatures with humanoid traits like feet, arms, and legs. The attributes for the feet trait could be the shoe color that the creature is wearing.
The more unique and scarce an NFT is, AKA rare, the more valuable it will be. A tried and true way to calculate rarity is to look at the attributes of a given NFT and calculate the number of occurrences for each attribute in the total collection. Fewer occurrences mean that an NFT with those attributes is considered rare.
This guide will show how you can seek some NFT alpha and quickly evaluate the rarity of an NFT using the GoldRush API!
Prerequisite
Fetching data using APIs
Basic familiarity with Node.js (optional)
Use Cases for Developers
There are several use cases for a developer wanting to know the rarity of an NFT. Some examples of projects leveraging NFT rarity include:
Investment tools
Authentication features
Games with rare items
NFT rarity calculators
Wallets with unique NFT rarity features
Getting NFT Rarity Data
1
Sign up or sign in
2
Find the API Reference
3
Find the right NFT endpoints
4
Get traits
0x59468516a8259058baD1cA5F8f4BFF190d30E066
. We also find that this collection is on Ethereum, so we will use eth-mainnet
as the chainName
parameter.5
Hit Run
collectionContract
(in our case, 0x59468516a8259058baD1cA5F8f4BFF190d30E066
) and hit Run. In this code block is a snippet of the response you will see.Red Shoes
for the trait Feet
. We don’t know how rare red shoes are until we examine the rest of the attributes.6
Get attributes
chainName
and collectionContract
parameters, we now include the trait
parameter. Let’s use the first trait from our previous response and input Feet
. Hit Run and you should see a similar response.count
/number of IDs for the collection)7
Get trait summary
chainName
and collectionContract
, hit Run. The response you see will look the same as our previous step but will include values for all trait types!trait_percentage
field, AKA the rarity of a certain trait based on how often it occurs in the collection.Shoe Gum
. Out of the total number of IDs in the collection (4999 -also contained in the response), the percentage of this trait occurring is 5.34%.(267/4999) =0.05341068213642729
(0.05341068213642729 * 100) = 5.34%
Sample Code
Sample code for making a request to the Get Trait Summary for a collection endpoint and searching for the rarity of a given trait name:
1
Copy
sample.js
file.2
Run
node sample.js
from the command line to get the rarity percentage of a given trait name
.Conclusion
To summarize, NFT rarity is determined by the uniqueness of its attributes and the scarcity of similar items. This includes factors such as wearable art pieces, rare colors or features, and whether it is part of a limited series. The more unique and scarce an NFT is, the more valuable and rare it becomes. Developers can leverage NFT rarity for various use cases, including investment tools, authentication features, games with rare items, and NFT rarity calculators. To obtain NFT rarity data, developers can use the GoldRush API endpoints to get traits for a collection, attributes for a collection trait, and trait summary for a collection. By understanding the trait types and the types of attributes for each trait, developers can calculate the rarity of an NFT based on the number of occurrences of each attribute.
Check out our other NFT endpoints to get NFT metadata, balances, transactions, check ownership and more!