NFT api question

api/v2/0x197bf44771e43006e34d84595a5930a718d57f9b/nft

  1. First of all does not able to fetch OpenSea NFTs.
  2. getting some NFTs but there is no metadata or no attributes.

while collection store has metadata and attributes

Please, help to sort out this.

I see it returns 2 nfts, one has metadata and the other doesn’t.
It should automatically sync at some time the metadata for that one too. (you can use resyncMetadata endpoint if you want a faster sync)

NFTs from opensea could be missing if they are only lazy minted.

[quote=“cryptokid, post:2, topic:16736”]

there is no attributes also which has metadata.

This is the output, one has metadata and one doesn’t.

I don’t know what you mean with attributes.

"result": [
    {
      "token_address": "0xcc15b249f8ac06b4a56deb5627afcef061df45a4",
      "token_id": "535",
      "amount": "1",
      "owner_of": "0x197bf44771e43006e34d84595a5930a718d57f9b",
      "token_hash": "cbfdf15b2bded80734b200bc4c7d2547",
      "block_number_minted": "15013358",
      "block_number": "15024099",
      "contract_type": "ERC721",
      "name": "SpunMonkes",
      "symbol": "SPUNMONKES",
      "token_uri": "https://ipfs.moralis.io:2053/ipfs/QmUdGVCveabh6K3oiQxTPjVh2CArLuQVdxyvUtL3cJ4Hn5/535.json",
      "metadata": null,
      "synced_at": null,
      "last_token_uri_sync": "2022-06-23T14:18:44.870Z",
      "last_metadata_sync": null
    },
    {
      "token_address": "0x01bb8aac93261afc869ac612814852de0459af5b",
      "token_id": "4552",
      "amount": "1",
      "owner_of": "0x197bf44771e43006e34d84595a5930a718d57f9b",
      "token_hash": "be686f930cbb3bcd17241da51eedd3ef",
      "block_number_minted": "15009140",
      "block_number": "15024092",
      "contract_type": "ERC721",
      "name": "Galactic Tavern Aliens",
      "symbol": "GTA",
      "token_uri": "https://ipfs.moralis.io:2053/ipfs/QmcCoYrGArY5S5rvgU7HZoz8kVJPginn9Mh8PaY9bEWkD5",
      "metadata": "{\"name\":\"Galactic Tavern Aliens\",\"description\":\"A collection of 5555 Galactic Tavern Aliens spread across 5 different species with varying traits makes the Galactic Tavern a variety filled safe haven for all species to relax and enjoy their free time with drinks, music and moaning about the market. No matter what intergalactic spaceforce is after you or how bad goblin town hits ya, you are safe asong as you are here.\",\"image\":\"ipfs://QmazymkgVoyJ2gKT8Ct91Ziu6p4Qj7GLJh4Z4UFmNpciYX\",\"attributes\":[]}",
      "synced_at": "2022-06-22T19:44:35.436Z",
      "last_token_uri_sync": "2022-06-22T19:44:11.729Z",
      "last_metadata_sync": "2022-06-22T19:44:35.436Z"
    }
  ],

“metadata”: "{“name”:“Galactic Tavern Aliens”,“description”:“A collection of 5555 Galactic Tavern Aliens spread across 5 different species with varying traits makes the Galactic Tavern a variety filled safe haven for all species to relax and enjoy their free time with drinks, music and moaning about the market. No matter what intergalactic spaceforce is after you or how bad goblin town hits ya, you are safe asong as you are here.”,“image”:“ipfs://QmazymkgVoyJ2gKT8Ct91Ziu6p4Qj7GLJh4Z4UFmNpciYX”,“attributes":[]}”,

my mean with properties

I don’t know where from those attributes are extracted, as are not present in the metadata info.

These properties have not come from the metadata’s attributes (so they are not on-chain through the token_uri).

If you wanted to get these OpenSea specific properties, you would need to use OpenSea’s API.

E.g. Retrieve an asset with address of 0x01bb8aac93261afc869ac612814852de0459af5b and token_id of 4552 (Galactic Tavern Alien #3180) gives:

"traits": [
    {
      "trait_type": "Appendage",
      "value": "None",
      "display_type": null,
      "max_value": null,
      "trait_count": 2999,
      "order": null
    },
    {
      "trait_type": "Head Accessory",
      "value": "None",
      "display_type": null,
      "max_value": null,
      "trait_count": 2895,
      "order": null
    },
    {
      "trait_type": "Clothes",
      "value": "Neon Trackie",
      "display_type": null,
      "max_value": null,
      "trait_count": 180,
      "order": null
    },
...

You can also use Moralis’s OpenSea plugin.