getAssetsByGroup
Returns the list of assets given a group (key, value) pair. This method uses 160 credits from your daily balance.
Parameters
- groupKey: (string) [required] - The key of the group (for example- collection).
- groupValue: (string) [required] - The value of the group.
- sortBy: (object) [optional] - Sorting criteria for the results:- sortBy- The field to sort by. Possible values:- created,- updated,- recent_action,- id,- none.
- sortDirection- The sort direction. Possible values:- asc,- desc.
 
- limit: (number) [optional] - The maximum number of assets to retrieve.
- page: (number) [optional] - The index of the page to retrieve.
- before: (string) [optional] - Retrieve assets before the specified ID.
- after: (string) [optional] - Retrieve assets after the specified ID.
Returns
result - An object containing the following fields:
- total- The total number of assets matching the query.
- limit- The maximum number of assets returned in this response.
- items- An array of asset objects. Each asset object contains:- interface- The interface type of the asset. Return types include:- V1_NFT,- V1_PRINT,- LEGACY_NFT,- V2_NFT,- FungibleAsset,- FungibleToken,- Custom,- Identity,- Executable,- ProgrammableNFT.
- id- The ID of the asset.
- content- An object containing the metadata and content information:- $schema- The schema URI.
- json_uri- The URI pointing to the asset's JSON metadata.
- files- List of associated files with- uri,- mime, and optional- contexts.
- metadata- An object containing the metadata information:- name- The name of the asset.
- symbol- The symbol of the asset.
- description- A description of the asset.
- attributes- List of attributes with- trait_typeand- value.
- token_standard- The token standard of the asset.
 
 
- ownership- An object containing the ownership details:- owner- The owner's public key.
- frozen- Whether the asset is frozen.
- delegated- Whether the asset is delegated.
- delegate- The delegate's public key.
- ownership_model- The ownership model, for example- singleor- token.
 
- compression- An object containing the asset compression details:- eligible- Whether the asset is eligible for compression.
- compressed- Whether the asset is compressed.
- data_hash- The data hash of the asset.
- creator_hash- The creator hash of the asset.
- asset_hash- The asset hash.
- tree- The Merkle tree ID.
- seq- The sequence number.
- leaf_id- The leaf ID.
 
- royalty- An object containing the royalty details:- royalty_model- The royalty model (- creators,- fanout, or- single).
- target- The target address for royalties.
- percent- The royalty percentage.
- basis_points- The royalty in basis points.
- primary_sale_happened- Whether the primary sale has occurred.
- locked- Whether the royalty is locked.
 
- creators- List of creators:- address- The creator's public key.
- share- The creator's share percentage.
- verified- Whether the creator is verified.
 
- grouping- Grouping details:- group_key- The group key (for example,- collection).
- group_value- The group value.
 
- uses- An object containing the usage details:- use_method- The usage method (- burn,- multiple, or- single).
- remaining- The remaining uses.
- total- The total uses.
 
- mutable- Whether the asset is mutable.
- burnt- Whether the asset is burnt.
 
Example
Replace <YOUR-API-KEY> with your API key.
Request
- curl
curl https://solana-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetsByGroup", "params": ["collection", "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac", {"sortBy": "created", "sortDirection": "desc"}, 50, 1, null, null]}'
Response
- JSON
{
  "jsonrpc": "2.0",
  "result": {
    "total": 50,
    "limit": 50,
    "page": 1,
    "items": [
      {
        "interface": "V1_NFT",
        "id": "An7sN8sjhd7bBzsNoryPYtrRdgjPixT4FFsSxPSxnf5g",
        "content": {
          "$schema": "https://schema.metaplex.com/nft1.0.json",
          "json_uri": "https://famousfoxes.com/metadata/9713.json",
          "files": [
            {
              "uri": "https://famousfoxes.com/hd/9713.png",
              "mime": "image/png"
            }
          ],
          "metadata": {
            "attributes": [
              {
                "value": "Cream",
                "trait_type": "Background"
              },
              {
                "value": "Jacket Red",
                "trait_type": "Outfit"
              },
              {
                "value": "Natural",
                "trait_type": "Skin"
              },
              {
                "value": "Blue",
                "trait_type": "Eyes"
              },
              {
                "value": "Toothy",
                "trait_type": "Mouth"
              },
              {
                "value": "Cap Fire",
                "trait_type": "Head"
              },
              {
                "value": "True",
                "trait_type": "Summoned"
              }
            ],
            "description": "The Famous Fox Federation, an independent organization of the most fabulously famous foxes on the Blockchain.",
            "name": "Fox #9713",
            "symbol": "FFF",
            "token_standard": "NonFungible"
          },
          "links": {
            "image": "https://famousfoxes.com/hd/9713.png",
            "external_url": "https://famousfoxes.com"
          }
        },
        "authorities": [
          {
            "address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
            "scopes": [
              "full"
            ]
          }
        ],
        "compression": {
          "eligible": false,
          "compressed": false,
          "data_hash": "",
          "creator_hash": "",
          "asset_hash": "",
          "tree": "",
          "seq": 0,
          "leaf_id": 0
        },
        "grouping": [
          {
            "group_key": "collection",
            "group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac"
          }
        ],
        "royalty": {
          "royalty_model": "creators",
          "target": null,
          "percent": 0.042,
          "basis_points": 420,
          "primary_sale_happened": true,
          "locked": false
        },
        "creators": [
          {
            "address": "442t3gHbw55CqiEAtoSWasVQ3eAhmYW2gPy5jqJNTdcw",
            "share": 0,
            "verified": true
          },
          {
            "address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA",
            "share": 100,
            "verified": false
          }
        ],
        "ownership": {
          "frozen": false,
          "delegated": false,
          "delegate": null,
          "ownership_model": "single",
          "owner": "BJL17Qr3cKSMXWBFqvWN58FhRqZPqdJCXU9MJykUuS7w"
        },
        "supply": {
          "print_max_supply": 0,
          "print_current_supply": 0,
          "edition_nonce": 255
        },
        "mutable": true,
        "burnt": false
      },
      ...
    ]
  },
  "id": 1
}