How to get NFT metadata by only using wallet address

Hi I’m Rivindhu,

I want to build a website like opensea. When people come in to the website they should see their all nfts in the wallet by connecting their wallet to the website. Also users must be able to sell their NFTs without manually typing the “token id” and “contract address”.

I’ve already created, user to connect their wallets to the website and display all the NFTs in their wallet by using moralis “Get NFTs by wallet” api and thirdweb sdk.

But I still unable to create a functionality to user to sell their NFTs without manually typing the “token id” and “contract address”.

But I believe this could be done by using moralis api to get NFT metadata by only using wallet address (like “Get NFTs by wallet” api). If this possible I can get the “contract address” and “token id” metadata by using moralis api, and after that I can call the thirdweb “list for sale” function to allow user to sell their nfts in the wallet without manually typing the “contract address” and “token id”.

To achieve this I need your help. Thank you!

You don’t have already the metadata for the nfts with get nfts by wallet endpoint?

How do you want for this sell to work if they don’t have to know what contract and token id they want to sell?

This already returns the token address and the id.
I am not sure how your website is built but you can map the address and the token id and send that information when you call your “sell” function.
That information is already there, you will just have to get it from the API response and use it when you trigger the function