Different IPFS syntax on different NFTs from the same collection

Hello guys. I tried to fetch all metadata from a Polygon collection (Brozo), and I saw they not all have the syntax for the IPFS URL. So I’m currently taking the token_id of each of these nfts and add it to the right url to fetch metadata.

Just to notice it :wink:

Hey @LoLoSenPai,

Not very sure what you mean, can you paste one of the token URL here so we can take a look? :grinning_face_with_smiling_eyes:

Hi! Sorry for the slow answer ^^’

For example, this is the contract adress of Brozo on Polygon: 0x220fa5cCc9404802ED6DB0935EB4feeFC27C937e

If you try to use getNFTMetadata, you will see null metadata until token id 109 where the token_uri syntax is different.
For this one, there is metadata. So I had to make an algo to put on an array of null metadata objects, and change token_uri to add the missing metadata

And I had the same problem with Rekt Dogs collection on Polygon.

token id 1
{
“token_address”: “0x220fa5ccc9404802ed6db0935eb4feefc27c937e”,
“token_id”: “1”,
“amount”: “1”,
“owner_of”: “0x71f1ac03c1eb4be2054e0e47142b6e2ee20b81f5”,
“token_hash”: “c4b7e88db623657b721f630fa2aa2111”,
“block_number_minted”: “40847444”,
“block_number”: “40847444”,
“transfer_index”: [
40847444,
57,
195,
0
],
“contract_type”: “ERC721”,
“name”: “BROZO”,
“symbol”: “brozo”,
token_uri”: “ipfs:/bafybeiagxrfu3iporwtopibjudn67ayv5hqbrlk4n5y2dgftikl7drrcq4/1.json”,
“metadata”: null,
“last_token_uri_sync”: “2023-03-28T03:08:20.127Z”,
“last_metadata_sync”: “2023-03-28T03:08:22.328Z”,
“minter_address”: “0x74dba10914d2fc858d2abbc9b6c26c44e7d1a9a4”,
“possible_spam”: false
}

token id 109
{
“token_address”: “0x220fa5ccc9404802ed6db0935eb4feefc27c937e”,
“token_id”: “109”,
“amount”: “1”,
“owner_of”: “0x1994bce3888fb911f06ffb697011b93a95d9cb29”,
“token_hash”: “28b26c65e924ea8fd3cb73b299e5e31e”,
“block_number_minted”: “40872417”,
“block_number”: “40892062”,
“transfer_index”: [
40892062,
59,
245,
0
],
“contract_type”: “ERC721”,
“name”: “BROZO”,
“symbol”: “brozo”,
token_uri”: “https://ipfs.moralis.io:2053/ipfs/bafybeihzyj2llmktqysywwqakunwcdhfqkocr23dbh4y2m6wcid57j4bs4/109.json”,
“metadata”: “{“name”:“BROZO #109”,“description”:“BROZO is a movement. Be part of it.”,“image”:“https://bafybeidrb5yrsuxij5h5ff7fjhzpgpeax7eroyytb3tacuwc2l4ml2z3ba.ipfs.nftstorage.link/109.png?ext=png",“dna”:“8166a3245f3b09f9aaa9e316194e74aeb4cc4537”,“edition”:109,“date”:1678891797777,“attributes”:[{“trait_type”:“Background”,“value”:"G0LD B4RBED”},{“trait_type”:“Shell”,“value”:“CL33N”},{“trait_type”:“Eyes”,“value”:“S1DE3YE”},{“trait_type”:“Head”,“value”:“DR3ADS”},{“trait_type”:“Shades”,“value”:“N0NE”},{“trait_type”:“Clothing”,“value”:“D3M0NBR0”},{“trait_type”:“Mouth”,“value”:“SM1L3”},{“trait_type”:“Career”,“value”:“OFF1C3R”},{“trait_type”:“District”,“value”:“XV”}]}”,
“last_token_uri_sync”: “2023-04-06T16:58:39.611Z”,
“last_metadata_sync”: “2023-04-16T02:23:36.213Z”,
“minter_address”: “0x9f473e85bef999d985e26b927db25ca035f9f868”,
“possible_spam”: false
}

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.