How to get image of NFT

With this I get the token.uri of my NFT#s

for (let i=0; i < data.length; i++){
        let row = `<tr>
        table.innerHTML += row

Which gives me the ipfs link like this

but how can I print oout the actual image of the NFT in a table, using above example

I tried
<td><img src="${data[i].token_uri['image'}"></td>
but this doesnt do the trick
can anyone help, please?

this should be the metadata from that IPFS link:


you can check if metadata field is set for that token_id and you can extract the mage from there

is there a solution for this?
A code would be helpful
Ivan uploads a video and nobody can see the code, i dont know whats the ponit of making a video if you cant see the code

1 Like

ok, it is not easy, from this link: ipfs://QmPk4py59eWaWPFqByDrXnoz4r4knthxBykovzwHaq21DM
you have to get to another link like

its not easy, well just share the code, you guys have already done it so why dont you just share instead of saying its not easy
and i agree its not easy to make this work if you watch a video and you cant see the code, lol

from ipfs://QmPk4py59eWaWPFqByDrXnoz4r4knthxBykovzwHaq21DM you have to get to

dude, I know, but I would like to see a code on how to do this
by the way is there a github for the code ivan uses, his video is pretty useless without a code.

you can find some examples on forum: How To Get User NFTs? All NFTs Owned by Address - @Ivan on Tech Explains

ok that helps dude thanks

I fixed the chain issue but nothing ever works out the box, I dont understand why there isnt a code I can just copy and paste and it works
there is always nothing but issues, this is so frustrating, i have to ask about everything cause nothing works

I dont understand why you even make tutorials that dont work, honestly whats the point doing this?
Everytime I can rewrite the code cause everything changes all the god damn time

that tutorial is a little outdated, things change over time


    <script src="[email protected]/dist/moralis.js"></script>
    <script src=""></script>
    <script src=""></script>
<div id="content"></div>

        Moralis.serverURL = "";

   // Moralis.initialize("lRCkcYjDbFtpxYwnA4un13UtUi7RqBfVtyjx5g0n"); // Application id from
  //Moralis.serverURL = ""; //Se

  async function getNFTs(){

    const options = { chain: 'matic', address: 'wallet address here'}

    const nfts = await Moralis.Web3.getNFTs(options);

       let url = fixURL(nft.token_uri);
      .then(response => response.json())
      .then(data => {
         $("#content").html($("#content").html()+"<img width=200 hight=100 src='"+fixURL2(data.image)+"'/>");



 function fixURL(url){
     return ""+url.split("ipfs://ipfs/").slice(-1)[0];
    return url+"?format=json"
 function fixURL2(url){
     return ""+url.split("ipfs://").slice(-1)[0];


1 Like