[SOLVED] getTokenIdMetadata returns metadata:null

 const options = {
        chain: '0x13881',
        format: 'decimal',
        address: '',
        token_id: 1,
      await Moralis.Web3API.token.getTokenIdMetadata(options)

Sadly returns: metadata: null
When I open the URI I can see the metadata.

Did you try to resync the metadata/uri?

Hi, could you please explain how to do that?


You can also do it from web3api interface in admin interface

1 Like

Getting this reply:

  "status": "The metadata could not be updated! Try again later"

What shall I do now?

Try to resync the uri, can you paste the output from getTokenIdMetadata

Example Output:

1. amount: "1"
2. block_number: ""
3. block_number_minted: ""
4. contract_type: "ERC721"
5. creatorId: "0"
6. frozen: 0
7. is_valid: 0
8. metadata: null
9. name: "##"
10. owner_of: ""
11. price: ""
12. symbol: ""
13. synced_at: ""
14. syncing: 2
15. token_address: ""
16. token_id: ""
17. token_uri: ""

I could now just fetch the token_uri, but that is obviously not what I wantโ€ฆ

Iโ€™ll have to look in more details

For consistency you will likely need to always use token_uri in some way, whether that is the first or backup option (if the metadata property is empty). Itโ€™s fairly common that metadata wonโ€™t have been populated from the token_uri.

Thanks for the replies. Finally I found an additional comma, which rendered my JSON useless. This topic can be closed as solve. Thanks for the work.

1 Like