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.

Liki Crus
  • 1,901
  • 5
  • 16
  • 27

1 Answers1

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.

Greg Sadetsky
  • 4,863
  • 1
  • 38
  • 48
cherry
  • 389
  • 5
  • 16
  • 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}"); }` – AndroidNoob Nov 25 '21 at 10:08
  • does this work on the testnet mumbai? Tried playing around with it and didn't reach success yet – Matt Swezey Nov 26 '21 at 21:52
  • 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. – Liki Crus Dec 05 '21 at 19:31
  • 8
    I get `"success": false` when trying to refresh my polygon NFT collection – Oscar Chambers Dec 15 '21 at 14:15
  • 2
    Seems this does not work at all for assets on Polygon... – Oscar Chambers Dec 29 '21 at 11:30
  • 3
    This doesn't work anymore – Shubham Bansal Feb 22 '22 at 03:47
  • It doesn't work on Polygon. Please try to use this: [NFT refresh on OpenSea](https://www.nftrefreshmetadata.com/) – Liki Crus Apr 12 '22 at 14:48
  • @LikiCrus's link didn't work for me for a collection hosted on mainnet. – Tim Daubenschütz Jun 06 '22 at 22:20
  • @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. – Liki Crus Jun 06 '22 at 22:28
  • 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. – Tim Daubenschütz Jun 06 '22 at 22:31
  • @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. – Liki Crus Jun 06 '22 at 22:47
  • 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. – luxo Jun 30 '22 at 12:26
  • 1
    Is there any solution that works on a polygon network? – George Imerlishvili Aug 10 '22 at 13:28