The uri
need to point to a json file.
The json file works with IPFS but over HTTP they usually add the ID of the NFT at the end of the URI which the IPFS Json file will no handle.
Json file = IPFS (one file per NFT) <-- Decentralize
API = HTTP request a DB by NFT ID. (one DB for all NFTs) <-- Centralized
The Json format is used in all cases.
This is the "ERC721 Metadata JSON Schema" referenced above.
{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents"
},
"description": {
"type": "string",
"description": "Describes the asset to which this NFT represents"
},
"image": {
"type": "string",
"description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
}
}
}
From the official ERC721 EIP.
You can also check opensea documentation which is more factual.
uri
point to json ? Then check you json format, opensea use this format.