Is there any way to force to update metadata on Opensea?
Asked Answered
C

2

8

I tried to change token base URL to display the new images of NFTs on opensea.io. But it is not updated immediately.

There is a way to update by specifying force_update=true on Rikeby testnet.

But I don't know how to update it on mainnet. Will it be possible?

Any help will be appreciated.

Caning answered 26/8, 2021 at 9:26 Comment(0)
F
15

Try this URL:

https://api.opensea.io/api/v1/asset/<your_contract_address>/<token_id>/?force_update=true

please tell me if this works.

This method may not work on another mainnet example polygon.

Update: There is a manual refresh for metadata on opensea. One can always use that one too.

Flash answered 3/9, 2021 at 15:14 Comment(13)
I tried it myself and it looks like its worked! I was able to call in a loop for a range of tokens and opensea updated the data correctly: for (let tokenId = fromTokenId; tokenId <= toTokenId; tokenId++) { const url = "https://api.opensea.io/api/v1/asset/${contractAddress}/${tokenId}/?force_update=true"; await fetch(url); console.log("Done with ${tokenId}"); }Abnormality
does this work on the testnet mumbai? Tried playing around with it and didn't reach success yetGrandnephew
OpeanSea refreshing would take 1 or 2 minutes in my experience because all of requests are queued. So you need to wait for a while after API call.Caning
I get "success": false when trying to refresh my polygon NFT collectionDeliberative
Seems this does not work at all for assets on Polygon...Deliberative
This doesn't work anymoreDina
It doesn't work on Polygon. Please try to use this: NFT refresh on OpenSeaCaning
@LikiCrus's link didn't work for me for a collection hosted on mainnet.Impertinence
@TimDaubenschütz, please wait for a minute after refreshing. I normally used it. In my experience opensea has some issues with refreshing. That's it delays or omits the requests. So I had to try to run several times or had to refresh manually for specific items. This is annoying.Caning
I had waited several hours after running the script and I only ran the script once. I'm now using the above outlined endpoint iterating through tokenIds using a for loop in bash and curls. And I've gotten a 403 error when not defining a user agent. So now I've copied a popular browser's user agent and I'm getting 200 OK statuses.Impertinence
@TimDaubenschütz, I think you made a mistake on API call with CURL. If the API endpoint works on the browser, this will definitely work. There is no issue with axios API call on nodejs or PHP.Caning
Not sure if it was different in the past, but you need an API key from OpenSea to make that v1/asset GET call on mainnet ETH. They have a form to request one on their site. I've heard they can be stingy at times with giving them out.Alinealinna
Is there any solution that works on a polygon network?Devisal
B
0

OS updated the api to v2. https://docs.opensea.io/reference/refresh_nft

https://api.opensea.io/api/v2/chain/{chain}/contract/{address}/nfts/{identifier}/refresh
Brothers answered 14/11, 2023 at 14:25 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.