> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniblock.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Collection Rarity Summary

> Get summary of attribute prevalence for an NFT collection. Commonly used to calculate rarity scores for a collection based on its traits.



## OpenAPI

````yaml /reference/api-json.json get /nft/collection/rarity
openapi: 3.0.0
info:
  title: Unified Request
  description: One API for all your web3 needs.
  version: '1.0'
  contact: {}
servers:
  - url: https://api-test.uniblock.dev/uni/v1
    description: Test-Gateway
security:
  - {}
  - ApiKeyAuth: []
tags: []
paths:
  /nft/collection/rarity:
    get:
      tags:
        - NFT
      summary: Get Collection Rarity Summary
      description: >-
        Get summary of attribute prevalence for an NFT collection. Commonly used
        to calculate rarity scores for a collection based on its traits.
      operationId: NFTCollectionRarity
      parameters:
        - name: chainId
          required: true
          in: query
          description: Unique identifier for a blockchain network.
          schema:
            default: 1
            example: 1
            enum:
              - 1
              - 10
              - 100
              - 10143
              - 10200
              - 1088
              - 1101
              - 11011
              - 11124
              - 11155111
              - 11155420
              - 11297108109
              - 1284
              - 1285
              - 130
              - 1301
              - 1329
              - 137
              - 1666600000
              - 167000
              - 167009
              - 168587773
              - 1868
              - 1946
              - 2020
              - 2442
              - 248
              - 25
              - 250
              - 2741
              - 288
              - 300
              - 324
              - 33111
              - 33139
              - 360
              - 37111
              - 4002
              - 42161
              - 421614
              - 42170
              - 42220
              - 43113
              - 43114
              - 480
              - 4801
              - 5000
              - 534351
              - 534352
              - 5371
              - 5373
              - 56
              - 59141
              - 59144
              - 7000
              - 7001
              - 7777777
              - 80002
              - 80094
              - 81457
              - 8453
              - 84532
              - 9001
              - 97
              - 999999999
              - solana
              - solana-devnet
            type: string
        - name: contractAddress
          required: true
          in: query
          description: The address of the NFT collection to query.
          schema:
            default: '0x81Ae0bE3A8044772D04F32398bac1E1B4B215aa8'
            example: '0x81Ae0bE3A8044772D04F32398bac1E1B4B215aa8'
            type: string
        - name: includeRaw
          required: false
          in: query
          description: >-
            Returns the raw data given by the provider. WARNING: removes backup
            feature, and raw data returned is not normalized which might make
            switching providers difficult
          schema:
            example: null
            type: boolean
        - name: provider
          required: false
          in: query
          description: >-
            Specify which provider to use. The project's provider priority list
            is used by default if no providers are selected. (Priority list can
            be managed on Uniblock's dashboard)
          schema:
            enum:
              - Alchemy
              - GoldRush
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NFTCollectionRarityResponse'
components:
  schemas:
    NFTCollectionRarityResponse:
      type: object
      properties:
        traits:
          description: The traits of the NFT collection.
          type: array
          items:
            $ref: '#/components/schemas/NFTCollectionRarityResponseItem'
      required:
        - traits
    NFTCollectionRarityResponseItem:
      type: object
      properties:
        name:
          type: string
          description: The name of the trait.
          example: Background
        token_count:
          type: string
          description: The token count of the trait's attributes.
          example: '10'
        trait_percentage:
          type: string
          description: The percentage of the trait's attributes.
          example: '10'
        attributes:
          description: The attributes of the trait.
          type: array
          items:
            $ref: '#/components/schemas/NFTCollectionRarityAttributeItem'
      required:
        - name
        - attributes
    NFTCollectionRarityAttributeItem:
      type: object
      properties:
        attribute_name:
          type: string
          description: The name of the attribute.
          example: Background
        count:
          type: string
          description: The count of the attribute.
          example: Red
      required:
        - attribute_name
        - count
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key to access the API (optional)

````