# NFT API endpoints

The latest documentation for endpoints is always on the DevPortal: \
<https://partner.socios.com/devportal/apis/f59193f0-b4ea-4eb7-83f8-8b1f2858f181/test>

{% openapi src="<https://31329255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMDcaoJLMj5Y3jzFMTONF%2Fuploads%2Fsk2wL96s6pcBscmiMgAX%2FNFT.json?alt=media&token=b5e9cb25-8dc7-4753-8945-2d2178c4fa0c>" path="/user/nfts" method="get" %}
[NFT.json](https://31329255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMDcaoJLMj5Y3jzFMTONF%2Fuploads%2Fsk2wL96s6pcBscmiMgAX%2FNFT.json?alt=media\&token=b5e9cb25-8dc7-4753-8945-2d2178c4fa0c)
{% endopenapi %}

{% hint style="success" %}
:arrow\_down: **ALTERNATIVE: Retrieve User NFT Balance** :arrow\_down:\
The following code will allow you to check how many NFT from a specific collection a user holds.&#x20;
{% endhint %}

<pre class="language-javascript" data-overflow="wrap" data-line-numbers><code class="lang-javascript"><strong>import { abi as erc721ABI } from './ERC721ABI.json';
</strong>async function getNFTBalance() {
  const balance = await client.readContract({
    address: '0xYourNFTAddress', // Replace with the actual NFT contract address
    abi: erc721ABI, // ERC-721 ABI
    functionName: 'balanceOf', // Standard ERC-721 function to get balance
    args: ['0xUserWalletAddress'], // User's address whose NFT balance you want to check
  });
  return balance.toString();
}

// Example usage
getNFTBalance().then(console.log);

</code></pre>

{% openapi src="<https://31329255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMDcaoJLMj5Y3jzFMTONF%2Fuploads%2Fsk2wL96s6pcBscmiMgAX%2FNFT.json?alt=media&token=b5e9cb25-8dc7-4753-8945-2d2178c4fa0c>" path="/nft/{id}" method="get" %}
[NFT.json](https://31329255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMDcaoJLMj5Y3jzFMTONF%2Fuploads%2Fsk2wL96s6pcBscmiMgAX%2FNFT.json?alt=media\&token=b5e9cb25-8dc7-4753-8945-2d2178c4fa0c)
{% endopenapi %}
