How to show an NFT in your app (images only)
Showing an image in your application is simple with Center with our Render NFT endpoint:
- Determine the address and token ID of the NFT you would like to show
- Determine what size and format you want (see options below)
- Construct the appropriate URL
- Our rendering URLs are constructed in a predictable manner:
https://api.center.dev/v2/{network}/{address}/nft/{tokenID}/render/{filename}
- Our rendering URLs are constructed in a predictable manner:
- Use this URL to render the media. This will work similarly to a CDN URL.
- Include your API key in the header as with any other request:
'X-API-Key: ${apiKey}'
- Include your API key in the header as with any other request:
What sizes and formats are available?
The filename parameter tells us how you would like the NFT to be rendered. It should be provided in the following format: size.format.
- size: This is required. It can either be a preset (
small,mediumororiginal) or a specific file dimension (400x400,750x750). Thesmallpreset is 200x200 and themediumpreset is 1000x1000.originalwill render the media in its original size and format.- Note: Media will be rendered in its original aspect ratio within the bounds of the size that is specified.
- format: This is optional. It is used to transform media into a desired format. This format can be
png,jpgorgif.
Example acceptable filename parameters are: medium,250x250.jpg,small.png,original,650x650.
Updated about 2 years ago