• About
  • Landing Page
  • Buy JNews
SB Crypto Guru News- latest crypto news, NFTs, DEFI, Web3, Metaverse
  • HOME
  • BITCOIN
  • CRYPTO UPDATES
    • GENERAL
    • ALTCOINS
    • ETHEREUM
    • CRYPTO EXCHANGES
    • CRYPTO MINING
  • BLOCKCHAIN
  • NFT
  • DEFI
  • WEB3
  • METAVERSE
  • REGULATIONS
  • SCAM ALERT
  • ANALYSIS
No Result
View All Result
  • HOME
  • BITCOIN
  • CRYPTO UPDATES
    • GENERAL
    • ALTCOINS
    • ETHEREUM
    • CRYPTO EXCHANGES
    • CRYPTO MINING
  • BLOCKCHAIN
  • NFT
  • DEFI
  • WEB3
  • METAVERSE
  • REGULATIONS
  • SCAM ALERT
  • ANALYSIS
No Result
View All Result
SB Crypto Guru News- latest crypto news, NFTs, DEFI, Web3, Metaverse
No Result
View All Result

NFT Picture API – Get Photographs from NFT Collections

SB Crypto Guru News by SB Crypto Guru News
September 18, 2023
in Web3
0 0
0
NFT Picture API –  Get Photographs from NFT Collections


At present’s article will present you the right way to get photographs from NFT collections utilizing the Moralis NFT picture API. Due to the accessibility of this instrument, you may seamlessly generate low, medium, and high-resolution thumbnails for any NFT picture with a single API name. You merely must name one of many supported endpoints whereas setting the media_items parameter to true. Right here’s an instance of what it appears to be like like for the getContractNFTs() endpoint: 

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.begin({
    apiKey: "YOUR_API_KEY",
    // ...and another configuration
  });

  const handle = "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB";

  const chain = EvmChain.ETHEREUM;

  const response = await Moralis.EvmApi.nft.getContractNFTs({
    handle,
    chain,
    "mediaItems": true,
  });

  console.log(response.toJSON());
};

runApp();

You simply have so as to add your Moralis API key, configure the handle and chain parameters, and run the script. In return, you’ll get an array of tokens from the gathering in query, all of which have NFT picture previews hooked up to them. Right here’s an instance of what the response will appear to be: 

// ...
"media": {
        "mimetype": "picture/png",
        "parent_hash": "0x21ba1263dd63696f0d9ede101b00a4e2f4985a854483076c92a3415624fca051",
        "standing": "success",
        "updatedAt": "2023-09-15T03:23:50.945Z",
        "media_collection": {
          "low": {
            "peak": 100,
            "width": 100,
            "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/evm/0x1/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/0xed1b0d5a973a63694e3d8cfb1a5ace4485b37eba2a7ea846a1f5e52ba934be0e/low.png"
          },
          "medium": {
            "peak": 250,
            "width": 250,
            "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/evm/0x1/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/0xed1b0d5a973a63694e3d8cfb1a5ace4485b37eba2a7ea846a1f5e52ba934be0e/medium.png"
          },
          "excessive": {
            "peak": 500,
            "width": 500,
            "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/evm/0x1/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/0xed1b0d5a973a63694e3d8cfb1a5ace4485b37eba2a7ea846a1f5e52ba934be0e/excessive.png"
          }
        },
        "original_media_url": "https://www.larvalabs.com/cryptopunks/cryptopunk9082.png"
      },
      "possible_spam": false,
      "verified_collection": true
    },
// ...

From right here, now you can seamlessly combine the NFT photographs into your platform to create a extra compelling person expertise! 

For those who’d wish to be taught extra about different supported endpoints and the way this works in additional element, then be a part of us on this article or take a look at the official NFT picture previews documentation.

Additionally, don’t neglect to enroll with Moralis if you wish to entry this {industry}’s main NFT API. You’ll be able to create your account without cost and begin constructing NFT initiatives within the blink of an eye fixed! 

Overview

Are you trying to construct an NFT market, NFT sport, Web3 pockets, or another platform centered round non-fungible tokens? Effectively, it doesn’t matter what NFT-based improvement endeavor you wish to embark on, you’ll want a seamless technique to fetch NFT photographs. Nevertheless, that is simpler stated than completed, and querying a blockchain community for knowledge could be a tedious process. Thankfully, you may sidestep the challenges by leveraging an NFT picture API. To be taught extra about this, be a part of us on this article as we introduce you to the Moralis NFT API! 

At present’s article will begin by masking the intricacies of NFT photographs. We’ll then instantly leap straight into the Moralis NFT API to elucidate why that is the {industry}’s premier interface. From there, we’re going to cowl the NFT picture fetching capabilities of the Moralis NFT API and the way it works in follow. As such, if you happen to’re already conversant in the ins and outs of NFT photographs, be at liberty to skip straight into the ”3-Step Tutorial: Get Photographs from NFT Collections…” part.

As well as, if you happen to’re fascinated about constructing extra refined Web3 initiatives, we advocate trying out extra instruments Moralis affords. The NFT API solely scratches the floor, and another industry-leading options embody the Streams API and the Value API. With the Streams API, you may seamlessly arrange Moralis webhooks to get notified about essential on-chain occasions. And with the Value API, you may effortlessly fetch all of the pricing knowledge you want! 

NFT Picture API –  Get Photographs from NFT Collections

With the instruments above, you may construct Web3 initiatives considerably sooner and extra effectively. Consequently, take the time now to enroll with Moralis without cost, and also you’ll have the ability to leverage the true energy of blockchain know-how in a heartbeat!

Nonetheless, let’s kickstart this text by exploring the intricacies of NFT photographs!

What’s an NFT Picture? 

To adequately clarify what an NFT picture is, we have to perceive the fundamental fundamentals of NFTs. So, what’s an NFT? 

NFT is an abbreviation for ”non-fungible token”. The time period ”non-fungible” comes from standard economics and describes one-of-a-kind property with distinctive properties. Consequently, an NFT is a completely distinctive cryptographic token that exists on a blockchain community like Ethereum. 

The individuality and immutability attributes of NFTs make them good for representing possession of different one-of-a-kind property like photographs, digital artwork, music, movies, tickets, in-game gadgets, and many others. 

Right here, it’s essential to emphasise the key phrases ”representing possession”. Primarily, the NFTs themselves aren’t precise photographs, movies, or different content material; as an alternative, they function distinctive tokens pointing to a different digital or bodily merchandise of their metadata. 

So, with that in thoughts, what’s an NFT picture? 

Briefly, an NFT picture is the picture {that a} token is related to and factors to in its metadata. These photographs can are available many codecs, together with JPG, JPEG, GIFs, TIFF, PNG, and many others. The photographs themselves are usually saved off-chain utilizing a decentralized file storage system just like the InterPlanetary File System (IPFS). 

What is an NFT Image?

Nevertheless, the photographs are an important a part of the NFTs and are generally what provides them worth. And since a picture is linked to a sure NFT, proudly owning that NFT typically implies possession of or proof of authenticity of that individual asset. 

NFTs Dapps and Greatest NFT APIs 

The Web3 {industry} witnessed a notable NFT increase again in 2021, leading to NFTs turning into widely known among the many common inhabitants. At the moment, folks actually began to grasp the utility of those tokens, and the outcome has been the emergence of many outstanding NFT-centered platforms! 

NFTs are extremely dynamic property, that means they’ve plenty of totally different use circumstances. And there are various platforms you may construct round these tokens, together with NFT marketplaces, NFT video games, Web3 wallets, portfolio trackers, and way more. 

For those who’d like, you may take a look at certainly one of our earlier articles to be taught extra about NFT utility! 

Nonetheless, it doesn’t matter what NFT-based platform you wish to create, you’ll at all times want an accessible technique to get and combine NFT knowledge, corresponding to photographs, into your venture. Nevertheless, querying a blockchain community like Ethereum for the mandatory data is tedious. Additionally, it has typically required an abundance of improvement time and sources. Thankfully, now you can circumvent this by utilizing Moralis’ industry-leading free NFT API!

Title - NFT API from Moralis Letting Devs Get NFT Collection Images

The Moralis NFT API affords unmatched efficiency and covers over three million NFT collections. This contains every little thing from established initiatives like CryptoPunks to less-known NFTs that dropped just some seconds in the past. 

Additionally, the Moralis NFT API is cross-chain suitable and helps greater than ten Ethereum Digital Machine (EVM) chains, together with Ethereum, Polygon, BNB Sensible Chain, Arbitrum, and lots of others.

The Moralis NFT API additionally supplies many options, making it stand out because the {industry}’s #1 interface. With solely a single line of code, you may get all NFTs owned by a person handle, get ERC-721 on-chain metadata, monitor trades by market, fetch NFT collections, and way more. 

Consequently, with Moralis’ NFT API, you may keep away from reinventing the wheel and construct your NFT-based initiatives each sooner and smarter! 

NFT Picture API 

The Moralis NFT API can also be a succesful NFT picture API, because it permits you to seamlessly generate thumbnails in low, medium, and excessive decision for NFT photographs with a single line of code! 

NFT Image API Art Image

With this characteristic, you may effortlessly enhance the person expertise of your NFT-based platforms by offering photographs optimized for various use circumstances. In consequence, you’ll have the ability to combine faster-loading photographs into your purposes, decreasing web page load occasions and enhancing efficiency!

The Moralis NFT picture API at the moment helps a number of picture codecs, together with PNG, GIFs, JPEG, JPG, TIFF, and others. What’s extra, sooner or later, we’re planning so as to add help for different media codecs, together with video. 

So, how does the NFT picture API work? 

NFT picture previews can be included when the question parameter media_items is ready to true. And NFT thumbnail previews are at the moment supported by all endpoints returning NFTs: 

  • getContractNFTs()
  • getNFTMetadata()
  • getMultipleNFTs()
  • getWalletNFTs()
  • getNFTOwners()
  • getNFTTokenIdOwners()

Let’s use the getContractNFTs() endpoint for example how the NFT picture API works in follow!

3-Step Tutorial: Get Photographs from NFT Collections Utilizing the Moralis NFT Picture API 

Within the following sections, we’ll present you the right way to get photographs from NFT collections utilizing the Moralis NFT picture API. For example the method, we’ll be utilizing the getContractNFTs() endpoint for instance. Due to the accessibility of this instrument, you may get the information you want in three easy steps: 

  1. Get a Moralis API key
  2. Name the getContractNFTs() endpoint with the media_item parameter
  3. Run the script 

Nevertheless, earlier than we dive into step one, you initially must cope with just a few stipulations! 

Conditions 

Earlier than you may proceed, it’s worthwhile to set up and arrange the next: 

You additionally must launch your most popular built-in improvement atmosphere (IDE), create a brand new venture folder, open a brand new terminal, and run the next command within the venture’s root folder to put in the Moralis SDK: 

npm set up moralis @moralisweb3/common-evm-utils

That’s it; you’re now able to proceed with the tutorial! 

Step 1: Get a Moralis API Key 

The very first thing you’ll want is an API key to make calls to the Moralis NFT picture API. As such, if you happen to haven’t already, click on on the ”Begin for Free” button on the high proper of the Moralis web site and arrange your account: 

NFT Image API Start for Free Button

Subsequent, click on on the ”Settings” tab, scroll down, and replica your API key:  

Copying NFT Image API

Hold the important thing shut at hand, as you’ll want it within the second step! 

Step 2: Name the getContractNFTs() Endpoint with the media_item Parameter

Now, with an API key at hand, you’re able to make calls to the Moralis NFT picture API. As such, arrange a brand new ”index.js” file and enter the next code: 

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.begin({
    apiKey: "YOUR_API_KEY",
    // ...and another configuration
  });

  const handle = "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB";

  const chain = EvmChain.ETHEREUM;

  const response = await Moralis.EvmApi.nft.getContractNFTs({
    handle,
    chain,
    "mediaItems": true,
  });

  console.log(response.toJSON());
};

runApp();

Subsequent, change YOUR_API_KEY with the Moralis API key you copied within the earlier step: 

From right here, configure the handle fixed to suit your request by including the handle of the gathering you want to question. Additionally, if you wish to get blockchain knowledge from one other community, make certain to vary the chain parameter accordingly: 

We then go handle and chain as parameters when calling the getContractNFTs() endpoint. What’s extra, to get the NFT thumbnail previews, we additionally make certain to incorporate the media_items parameter and set it to true:  

That’s all it’s worthwhile to do; all that continues to be from right here is operating the script! 

Step 3: Run the Script 

To run the script, open a brand new terminal, cd into the venture’s root folder, and execute the next command: 

node index.js

In return, you’ll obtain a response trying one thing like this containing low, medium, and high-resolution photographs for the NFTs within the assortment: 

// ...
"media": {
        "mimetype": "picture/png",
        "parent_hash": "0x21ba1263dd63696f0d9ede101b00a4e2f4985a854483076c92a3415624fca051",
        "standing": "success",
        "updatedAt": "2023-09-15T03:23:50.945Z",
        "media_collection": {
          "low": {
            "peak": 100,
            "width": 100,
            "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/evm/0x1/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/0xed1b0d5a973a63694e3d8cfb1a5ace4485b37eba2a7ea846a1f5e52ba934be0e/low.png"
          },
          "medium": {
            "peak": 250,
            "width": 250,
            "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/evm/0x1/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/0xed1b0d5a973a63694e3d8cfb1a5ace4485b37eba2a7ea846a1f5e52ba934be0e/medium.png"
          },
          "excessive": {
            "peak": 500,
            "width": 500,
            "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/evm/0x1/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/0xed1b0d5a973a63694e3d8cfb1a5ace4485b37eba2a7ea846a1f5e52ba934be0e/excessive.png"
          }
        },
        "original_media_url": "https://www.larvalabs.com/cryptopunks/cryptopunk9082.png"
      },
      "possible_spam": false,
      "verified_collection": true
    },
// ...

For those who go to the hyperlinks, you may view every thumbnail: 

NFT Image API Fetching Token Image Example

From right here, now you can seamlessly combine the varied thumbnails into your NFT initiatives to create a extra compelling person expertise! 

That’s it; when working with the Moralis NFT picture API, it doesn’t need to be more difficult to get NFT photographs. And in case you have adopted alongside this far, you’ll haven’t any bother fetching and integrating NFT knowledge into your future Web3 initiatives. As such, with Moralis, it has by no means been simpler to construct NFT-based platforms!

Furthermore, you may observe the identical steps for the opposite endpoints supported by NFT picture previews. In doing so, you may, as an illustration, get NFT picture previews for particular person tokens, all tokens from a selected Web3 pockets, and way more.

Abstract: Greatest NFT Picture API

In right this moment’s article, we dove into the ins and outs of the Moralis NFT API. In doing so, we realized that it’s additionally a succesful NFT picture API you should use to get thumbnail previews for any token. We additionally confirmed you the right way to use this instrument to fetch photographs from NFT collections in three easy steps: 

  1. Get a Moralis API key
  2. Name the getContractNFTs() endpoint with the media_item parameter
  3. Run the script

You’ll be able to observe the identical steps for another endpoint that helps NFT picture previews. This implies it’s also possible to get NFT photographs for particular person tokens, all tokens inside a pockets, and way more.

So, in case you have adopted alongside this far, you now know the right way to get photographs from NFT collections. From right here, now you can use this knowledge to combine thumbnail previews into your initiatives and create extra compelling person experiences! 

For those who appreciated this information, take into account trying out extra content material right here at Moralis. For example, discover ways to write a wise contract in Solidity or examine one of the best free crypto worth API. 

Additionally, do you know that you may entry instruments just like the NFT API, Value API, and Streams API freed from cost? All it’s a must to do is join free with Moralis, and you can begin constructing refined Web3 initiatives in a heartbeat! 



Source link

Tags: APIBitcoin NewscollectionsCrypto NewsCrypto UpdatesImageImagesLatest News on CryptoNFTSB Crypto Guru News
Previous Post

Exploring IoT Function in Environmental Sustainability –

Next Post

South Korea Tries to Shake Off the Terra Debacle, With Gaming Dominating Web3 Exercise

Next Post
South Korea Tries to Shake Off the Terra Debacle, With Gaming Dominating Web3 Exercise

South Korea Tries to Shake Off the Terra Debacle, With Gaming Dominating Web3 Exercise

  • Trending
  • Comments
  • Latest
Meta Pumps a Further  Million into Horizon Metaverse

Meta Pumps a Further $50 Million into Horizon Metaverse

February 24, 2025
How to Get Token Prices with an RPC Node – Moralis Web3

How to Get Token Prices with an RPC Node – Moralis Web3

September 3, 2024
AI & Immersive Learning: Accelerating Skill Development with AI and XR

AI & Immersive Learning: Accelerating Skill Development with AI and XR

June 4, 2025
The Metaverse is Coming Back! – According to Meta

The Metaverse is Coming Back! – According to Meta

February 7, 2025
Samsung Unveils ‘Moohan’ to Compete with Quest, Vision Pro

Samsung Unveils ‘Moohan’ to Compete with Quest, Vision Pro

January 29, 2025
NFT Rarity API – How to Get an NFT’s Rarity Ranking – Moralis Web3

NFT Rarity API – How to Get an NFT’s Rarity Ranking – Moralis Web3

September 6, 2024
Ripple To Replace SWIFT? XRP Analyst Breaks Down Recent Developments

Ripple To Replace SWIFT? XRP Analyst Breaks Down Recent Developments

0
SIFMA Pushes Back on Crypto Plans for Tokenized Stocks

SIFMA Pushes Back on Crypto Plans for Tokenized Stocks

0
Nasdaq-Listed DeFi Technologies Sets Up Shop in Dubai to Tap MENA’s Crypto Boom

Nasdaq-Listed DeFi Technologies Sets Up Shop in Dubai to Tap MENA’s Crypto Boom

0
From a football feast to deceitful dolphins: three art exhibitions not to miss at the Manchester International Festival – The Art Newspaper

From a football feast to deceitful dolphins: three art exhibitions not to miss at the Manchester International Festival – The Art Newspaper

0
Peter Thiel Launches Erebor, Bank for AI and Crypto Firms

Peter Thiel Launches Erebor, Bank for AI and Crypto Firms

0
Spot Bitcoin ETFs Near B In Total Inflows After B Surge

Spot Bitcoin ETFs Near $50B In Total Inflows After $1B Surge

0
Ripple To Replace SWIFT? XRP Analyst Breaks Down Recent Developments

Ripple To Replace SWIFT? XRP Analyst Breaks Down Recent Developments

July 4, 2025
Nasdaq-Listed DeFi Technologies Sets Up Shop in Dubai to Tap MENA’s Crypto Boom

Nasdaq-Listed DeFi Technologies Sets Up Shop in Dubai to Tap MENA’s Crypto Boom

July 4, 2025
Bitcoin Lightning Is A Dead End, Says Former Core Dev Garzik

Bitcoin Lightning Is A Dead End, Says Former Core Dev Garzik

July 4, 2025
Robinhood made OpenAI tradable… but is it legit

Robinhood made OpenAI tradable… but is it legit

July 4, 2025
From a football feast to deceitful dolphins: three art exhibitions not to miss at the Manchester International Festival – The Art Newspaper

From a football feast to deceitful dolphins: three art exhibitions not to miss at the Manchester International Festival – The Art Newspaper

July 4, 2025
TRON DAO Joins EthCC as WAGMI Sponsor, Co-Hosts Events With MetaMask and Arkham

TRON DAO Joins EthCC as WAGMI Sponsor, Co-Hosts Events With MetaMask and Arkham

July 4, 2025
SB Crypto Guru News- latest crypto news, NFTs, DEFI, Web3, Metaverse

Find the latest Bitcoin, Ethereum, blockchain, crypto, Business, Fintech News, interviews, and price analysis at SB Crypto Guru News.

CATEGORIES

  • Altcoin
  • Analysis
  • Bitcoin
  • Blockchain
  • Crypto Exchanges
  • Crypto Updates
  • DeFi
  • Ethereum
  • Metaverse
  • Mining
  • NFT
  • Regulations
  • Scam Alert
  • Uncategorized
  • Web3

SITE MAP

  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • HOME
  • BITCOIN
  • CRYPTO UPDATES
    • GENERAL
    • ALTCOINS
    • ETHEREUM
    • CRYPTO EXCHANGES
    • CRYPTO MINING
  • BLOCKCHAIN
  • NFT
  • DEFI
  • WEB3
  • METAVERSE
  • REGULATIONS
  • SCAM ALERT
  • ANALYSIS

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.