Skip to content

Instantly share code, notes, and snippets.

@jwahdatehagh
Last active July 31, 2024 16:20
Show Gist options
  • Save jwahdatehagh/899993491e37b85cfd4caece005d07a0 to your computer and use it in GitHub Desktop.
Save jwahdatehagh/899993491e37b85cfd4caece005d07a0 to your computer and use it in GitHub Desktop.
// Change these values
const COLLECTION_ADDRESS = "0xabc123"
const API_KEY = "b128..."
const START_ID = 1
const END_ID = 152
// Leave the below alone...
// Paste the entire file into the browser console and hit "Enter".
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms))
let id = START_ID
while (id <= END_ID) {
await fetch(`https://api.opensea.io/api/v2/chain/ethereum/contract/${COLLECTION_ADDRESS}/nfts/${id}/refresh`, {
"headers": {
"accept": "*/*",
"x-api-key": API_KEY
},
"method": "POST",
})
await delay(300)
id++
}
// Change these values
const COLLECTION_ADDRESS = "0xabc123"
const API_KEY = "b128..."
const IDS = [1, 2, 3]
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms))
for (const id of IDS) {
await fetch(`https://api.opensea.io/api/v2/chain/ethereum/contract/${COLLECTION_ADDRESS}/nfts/${id}/refresh`, {
"headers": {
"accept": "*/*",
"x-api-key": API_KEY
},
"method": "POST",
})
await delay(300)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment