I am trying to fetch the metadata out of a token URI which I found inside an NFT. The token URI looks like this:
https://api.opensea.io/api/v2/metadata/matic/<contract_address>/0x{id}
I tried using the hex form of the tokenId instead of {id}
but it just returns { success:false }
error on GET call.
The tokenId is:
25301351943351891415725927464477484049512317528648331027932693704579263506192
The same worked for another token with different token Id, but a different base url:
https://api.opensea.io/api/v1/metadata/0x495f947276749Ce646f68AC8c248420045cb7b5e/0x{id}
I observed that the version for the working URL is v1
and its on a different chain.
Opensea docs doesn't seem to talk anything about v2
.
Please help me on how to fetch the metadata from the URI mentioned above.