GET
/
getTokenDetails
import { setOnchainKitConfig } from '@coinbase/onchainkit';
import { getTokenDetails } from '@coinbase/onchainkit/api';

const response = await getTokenDetails({
  contractAddress: '0x...',
  tokenId: '1',
});
{
  "collectionName": "NFT Collection Name",
  "collectionDescription": "NFT Collection Description",
  "name": "NFT Name",
  "description": "NFT Description",
  "imageUrl": "https://example.com/image.png",
  "animationUrl": "",
  "ownerAddress": "0x...",
  "lastSoldPrice": {
    "amount": "0.0001",
    "currency": "ETH",
    "amountUSD": "0.242271"
  },
  "mimeType": "image/png",
  "contractType": "ERC721"
}

The getTokenDetails function returns data required to view an NFT

Before using them, make sure to obtain a Client API Key from Coinbase Developer Platform.

Returns

Promise<GetTokenDetailsResponse>

Parameters

GetTokenDetailsParams

Types

Query Parameters

contractAddress
string
required

The NFT contract address

tokenId
string
required

The token ID of the NFT

Response

200 - application/json

Successful response

The response is of type object.