NFTs Error after http requst - help!

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.

Yes this gets me all the metadata and info i want but still doesnt work for some:


@cryptokid

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.

I tried to look inside dashbord to see if there are paramaters of failed apis write but got this:

This should be a temporary error, you can try again after 2-3 minutes.

1 Like

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)
2 Likes

Now it works thank you so so much :heart: i really apriciate it.
I have a few more questions:
How can i get image from this


i tried a lot of different things - none worked

You need to JSON.parse(metadata) and you will be able to get the img link

1 Like