I still get the same error:
Maybe the problem is in opensea / zedrun or any other api.
For me this URL returns Status Code: 404
and {"success": false}
when I put it in the browser. This would mean that it doesnโt work.
You can try https://docs.moralis.io/moralis-server/web3-sdk/token#gettokenidmetadata, maybe it has all the data that you want to fetch.
What parameters did you use when calling that function?
I dont know they are all inside a loop. But it wokrs for some and for some not.
Looks like it isnt possible to get nft metadata from all nfts.
I talk about this function:
const options = { address: "0xd...07", token_id: "1", chain: "bsc" };
const tokenIdMetadata = await Moralis.Web3API.token.getTokenIdMetadata(options)
That has parameters, you can test it separately to see how it works.
I tested it in console seperatly it worked. But in function most worked but not all
What is an example that didnโt work? I mean with what parameters didnโt work.
This should be a temporary error, you can try again after 2-3 minutes.
So here are 2 that failed:
2021-09-29T14:06:34.802Z - Failed running cloud function getTokenIdMetadata for user MVainVDmeoCblOrbMBklnbH4 with:
Input: {"address":"0xb6a55e861e5f5aab81b2cef8793f4bac097f88d3","token_id":"45"}
Error: {"message":"[object Object]","code":141}
2021-09-29T14:06:34.697Z - Failed running cloud function getTokenIdMetadata for user MVainVDmeoCblOrbMBklnbH4 with:
Input: {"address":"0x2953399124f0cbb46d2cbacd8a89cf0599974963","token_id":"93084268948183484439357267895949697378867222742931717572378051732847858810980"}
Error: {"message":"[object Object]","code":141}
You need to specify the chain_id. Your collections are on matic
So it should be:
const options = {
address: "0xb6a55e861e5f5aab81b2cef8793f4bac097f88d3",
token_id: "45",
chain: "matic" };
const tokenIdMetadata = await Moralis.Web3API.token.getTokenIdMetadata(options)
Now it works thank you so so much i really apriciate it.
I have a few more questions:
How can i get image from this
You need to JSON.parse(metadata)
and you will be able to get the img link