Nft metadata image and background missing

Hi, our application runs on polygon and while pulling NFTs to metamask from polygon, the metadata like image, token id, background are not displaying correctly, either one is only visible of 3.

All this information is correctly visible on Opensea and as I read metamask pulls the metadata configuration from APIs of Opensea.

Please help me by providing us a resolution to the issue with documentation that we can follow to fix the issue.

Specifically, i need inputs on ‘image’ and ‘image_data’ and their functionality which may be a cause of the issue.

Thank you.

1 Like

Hi metamask support/ developer community,

Could anyone provide us some information on the issue posted here.

Thank you.

1 Like

Hello @Rogueguy , welcome to the metamask community . Standby , while a community moderator :woman_judge: :man_judge: Will assist you .

1 Like

Currently metadata for NFTs is pulled from the OpenSea API, which is only only supported on Ethereum mainnet.

Polygon API support is part of their V2 API release. (IE it should be supported soon)

3 Likes

Hey @HiroProtagonist thank you for providing the information.

Further, we can see that metadata is correctly being pulled in Metamask for our NFTs as we can see the image and token id. Now since the metadata is correctly fetched in Metamask, this should’nt be an issue related to the Blockchain as the metadata format for both ETH & MATIC are the same.

Please share you’re feedback and more information concerning above points.

Regards
Deepak.

It isn’t an issue of metadata format. It’s that OpenSea’s API doesn’t currently support Polygon.
From the OpenSea API docs page I linked above:

If it’s showing on Metamask, I have no idea why. Per their documentation, that isn’t currently a supported functionality. I would expect a call to the OpenSea API on polygon to time out (as there shouldn’t be a server listening. Might be an OpenSea testnet that’s public facing?)

1 Like

Is this something that changed within the past few months? I have some Polygon NFT’s I imported into MetaMask a few months ago, and they worked fine. I tried again today, and now I’m seeing this issue.

I’m not sure I understand why the OpenSea API is needed. The tokenURI() contract function should return everything necessary to display the NFT. Is that the way it used to work?

Going back through GitHub, I think it might have been the commit in metamask-mobile at 6b3448890bc52d4fa2c613f573dbc79cfb93cd98 from two months ago that broke Polygon NFTs. This surmise is based on a couple of hours spent browsing your repository, so I could be way off base.

It looks like ENABLE_OPENSEA_API is a configurable setting, but it doesn’t seem to be exposed anywhere in the UI. If there was a way to set it to OFF, would that make it so that it would use the contract functions instead of the OpenSea API? If so, I will file a feature request to make it configurable.

OpenSea’s V2 API (which supports Polygon) was just recently released, so I’m checking with the team on the specifics on that. Will update this post when I hear back from them.

Your thoughts make perfect sense to me. If you switch to Ethereum Mainnet, you’ll find the “enable OpenSea API” setting under Security and Privacy. But I’m pretty sure that won’t have any effect on Polygon. Might be worth a shot just to see though.

Thanks for the response. I do see the setting when I switch to Ethereum network, but it was already turned off.

Even now it sometimes works and sometimes doesn’t work when I add a Polygon NFT (by “doesn’t work”, I mean it fails to retrieve the metadata and shows the NFT as a black box with Symbol #Token_Id).

Any ideas why it might sometimes be able to retrieve metadata for a Polygon NFT? Reading the rest of this thread, I wouldn’t expect it to ever work, but the fact that it sometimes does gives me hope that there might be a way to make it work consistently.

That’s good news about OpenSea’s V2 API. It has been “coming soon” for like a year now. I don’t see anything about it on their website, but it makes sense that they would give you early access.

Still looking into this (code is not my forte, so I’m chatting with the people that do deal with it)
The V2 APIs rollout hasnt been publicized anywhere that I can find, so it’s possible its still in testing? I do know they recently acquired Gem, so all of their APIs are likely in a bit of transition. (https://opensea.io/blog/announcements/opensea-acquires-gem-to-invest-in-pro-experience/)

Their API overview page (API Overview ) used to have this

That reference has since been removed, but I also cant find anything in their documentation about Polygon specifically.

I should have more info soon. Just don’t want you feel like I forgot about you.

1 Like