List NFT Items in a Collection

You can list all the NFT items in an NFT collection by sending a GET request to the /nft/<nft_collection_name>/nftitems endpoint.

List NFT items in a collection.

GET https://api.playfix.io/nft/<nft_collection_name>/nftitems

Path Parameters

Name
Type
Description

nft_collection_name*

String

The name of the NFT. This will start with a prefix of "nfts/" followed by a ULID.

Query Parameters

Name
Type
Description

pageToken

String

Page token for next page. You can get this value from the nextPageToken field of a previous response.

pageSize

String

Max number of projects to return in a single page. Each response will contain one page. This can be any number from 1 to 100.

Headers

Name
Type
Description

Authorization*

String

Bearer <your_access_token>

{
  "nftItems": [
    {
      "name": "nftitems/01ggdqqd0mkkt7hz57a1g130yq",
      "nft": "<nft_collection_name>",
      "title": "Fast Car",
      "number": "1",
      "description": "blazing fast car",
      "imageUrl": "https://ipfs-gateway.playfix.io/ipfs/QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
      "imageCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
      "attributes": [
        {
          "property": {
          "name": "eyes",
          "value": "brown"
          }
        }
      ],
      "mintingTransactionHash": "0x8b7f9ef613ee8accb04824254029b43b9c88626f1e6c99a99900948455a8a5e9"
    }
  ],
  "nextPageToken": "nftitems/01ggcmc50efj4ftfnvykpgm0ma"
}

cURL API Call

curl --request GET \
  --url https://api.playfix.io/nft/<nft_collection_name>/nftitems \
  --header 'Authorization: Bearer <your_access_token>'

Python API Call

import requests

r = requests.get(
    "https://api.playfix.io/nft/<nft_collection_name>/nftitems",
    headers = {
        "Authorization": "Bearer <your_access_token>"
        }
    )

print(r.text)

Response

{
  "nftItems": [
    {
      "name": "nftitems/01ggdqqd0mkkt7hz57a1g130yq",
      "nft": "<nft_collection_name>",
      "title": "Fast Car",
      "number": "1",
      "description": "blazing fast car",
      "imageUrl": "https://ipfs-gateway.playfix.io/ipfs/QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
      "imageCid": "QmbAVZQhTmRwy57pr4NWuDMhxAC9yzU21GtaGP1f6bay8W",
      "attributes": [
        {
          "property": {
          "name": "eyes",
          "value": "brown"
          }
        }
      ],
      "mintingTransactionHash": "0x8b7f9ef613ee8accb04824254029b43b9c88626f1e6c99a99900948455a8a5e9"
    }
  ],
  "nextPageToken": "nftitems/01ggcmc50efj4ftfnvykpgm0ma"
}

Response Fields

  • nftItems - An array of objects. Each object contains the details of an NFT item in the NFT collection.

  • nextPageToken - A string that enable you to query the next page of the response if you have added multiple NFT items to the collections.

Use the nextPageToken as the value of the pageToken query parameter to view the next page of results if you have added more than 10 NFT items to the collections.

Also, you can set the pageSize parameter to a number between 1 and 100 to increase the default number of NFT items returned per page.

Example cURL API Call

curl --request GET \
  --url 'https://api.playfix.io/nft/<project_name>/nftitems?pageSize=100&pageToken=<your_nextPageToken>' \
  --header 'Authorization: Bearer <your_access_token>'

Example Python API Call

import requests

r = requests.get(
    "https://api.playfix.io/nft/<project_name>/nftitems",
    params = {
        "pageToken": "<your_nextPageToken>".
        "pageSize": "100"
        },
    headers = {
        "Authorization": "Bearer <your_access_token>"
        }
    )

print(r.text)

The example above sets the page size to 100 items per page.

Last updated