reingestContract
Triggers metadata refresh for an entire NFT collection and refreshes stale metadata after a collection reveal/collection changes
This endpoint is currently in BETA.
This endpoint is supported on the following chains and networks:
  • Ethereum: Mainnet
To see chain support across all features, check out the feature matrix.

Parameters

  • contractAddress: string - The address of the NFT contract/collection that needs to be refreshed

Returns

  • contractAddress: string - The address of the NFT contract/collection that is refreshing
  • reingestionState: string - The current state of the reingestion request
    • "does_not_exist" - The contract requested is not an NFT and does not contain proper metadata
    • "already_queried" - Contract already queried
    • "in_progress" - Ingestion in progress
    • "finished" - Ingestion complete
    • "queued" - Ingestion request placed into queue and awaiting execution
    • "queue_failed" - Queue job incomplete
  • progress: string - Percentage of tokens successfully refreshed

Example

Request

Fetch (JS)
Axios (JS)
Postman
Curl
Alchemy SDK
1
import fetch from 'node-fetch';
2
3
var requestOptions = {
4
method: 'GET',
5
redirect: 'follow'
6
};
7
8
const apiKey = "demo"
9
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/reingestContract`;
10
const contractAddr = "0xE9FCa552b9eb110c2d170962aF740725F71F5644";
11
const fetchURL = `${baseURL}?contractAddress=${contractAddr}`;
12
13
fetch(fetchURL, requestOptions)
14
.then(response => response.json())
15
.then(response => JSON.stringify(response, null, 2))
16
.then(result => console.log(result))
17
.catch(error => console.log('error', error));
Copied!
1
import axios from 'axios';
2
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/reingestContract`;
6
const contractAddr = "0xE9FCa552b9eb110c2d170962aF740725F71F5644";
7
8
var config = {
9
method: 'get',
10
url: `${baseURL}?contractAddress=${contractAddr}`,
11
headers: { }
12
};
13
14
axios(config)
15
.then(response => console.log(JSON.stringify(response.data, null, 2)))
16
.catch(error => console.log(error));
Copied!
1
URL: https://eth-mainnet.g.alchemy.com/nft/v2/demo/reingestContract?contractAddress=0xE9FCa552b9eb110c2d170962aF740725F71F5644
2
RequestType: GET
Copied!
1
curl --location --request GET 'https://eth-mainnet.g.alchemy.com/nft/v2/demo/reingestContract?contractAddress=0xE9FCa552b9eb110c2d170962aF740725F71F5644' \
2
--data-raw ''
Copied!
1
// Github: https://github.com/alchemyplatform/alchemy-sdk-js
2
// Setup: npm install @alch/alchemy-sdk
3
import {
4
Network,
5
initializeAlchemy,
6
refreshNftMetadata,
7
} from "@alch/alchemy-sdk";
8
9
// Optional Config object, but defaults to demo api-key and eth-mainnet.
10
const settings = {
11
apiKey: "demo", // Replace with your Alchemy API Key.
12
network: Network.ETH_MAINNET, // Replace with your network.
13
maxRetries: 10,
14
};
15
16
const alchemy = initializeAlchemy(settings);
17
18
// Print total NFT count returned in the response:
19
const refreshed = await refreshNftMetadata(
20
alchemy,
21
"0x5180db8F5c931aaE63c74266b211F580155ecac8",
22
"1590"
23
);
24
25
console.log("contract refreshed: " + refreshed);
Copied!
If you're having trouble running requests via Alchemy Web3.js, Fetch, or Axios, please refer to: NFT API Quickstart Guide

Response

1
{
2
"contractAddress": "0xe9fca552b9eb110c2d170962af740725f71f5644",
3
"reingestionState": "in_progress",
4
"progress": null
5
}
Copied!