NFT Assets
The Assets API allows you to retrieve basic metadata for individual NFTs or query multiple NFTs using various filters, such as contract address and owner address.
Core Functions
Get a Single NFT’s Info
To fetch the basic information of a single NFT, specify its chain short name, contract address, and token ID, combined in the format:
:chainShortName/:contractAddress/:tokenId
Refer to the table below for supported chains and their corresponding short names.
import { lootexApiClient } from './config';
await lootexApiClient.assets.getAsset('soneium/0xfc8e7bda94874f6baa591dd70af0fda1fca201ab/1');
Get NFTs Owned by a Wallet
To retrieve the NFT inventory of a wallet address, specify at least the chainId
and walletAddress
:
import { lootexApiClient } from './config';
await lootexApiClient.explore.assets({
chainId: 1868, // or 'ALL' if you want to retrieve from all supported chains
walletAddress: '0x7D878A527e86321aECd80A493E584117A907A0AB',
limit: 20,
page: 1,
});
Get NFTs from a Collection
You can query assets from a specific collection using the collectionSlugs
field. Construct a collection slug as:
${chainShortName}:${contractAddress}
For example, to get all NFTs from contract 0xfc8e7bda94874f6baa591dd70af0fda1fca201ab
on Soneium:
import { lootexApiClient } from './config';
await lootexApiClient.explore.assets({
chainId: 1868, // or 'ALL' if you want to retrieve from all supported chains
collectionSlugs: ['soneium:0xfc8e7bda94874f6baa591dd70af0fda1fca201ab'],
limit: 20,
page: 1,
});
Get Listed NFTs
You can search for NFTs that have valid listings or offers by specifying orderStatus
and integrate with Marketplace module to build a full-feature trading flow.
import { lootexApiClient } from './config';
await lootexApiClient.explore.assets({
chainId: 1868,
orderStatus: ['listing'], // Options: 'listing' | 'offer' | 'collection_offer'
collectionSlugs: ['soneium:0xfc8e7bda94874f6baa591dd70af0fda1fca201ab'],
limit: 20,
page: 1,
});
Combine Filters and Sorting
You can combine multiple filters and sorting options to tailor your query. For example:
import { lootexApiClient } from './config';
await lootexApiClient.explore.assets({
chainId: 1868, // or 'ALL' if you want to retrieve from all supported chains
walletAddress: '0x7D878A527e86321aECd80A493E584117A907A0AB',
collectionSlugs: ['soneium:0xfc8e7bda94874f6baa591dd70af0fda1fca201ab'],
orderStatus: ['listing'],
sortBy: 'bestListPrice', // Options: '-createdAt' | '-bestListPrice' | 'bestListPrice' | '-bestOfferPrice' | '-likeCount' | 'lastCreatedListingAt' | 'rarityRanking' | '-rarityRanking'
limit: 20,
page: 1,
});
Supported Chains
Chain ID | Chain Name | Short Name |
---|---|---|
1 | Ethereum | eth |
56 | BNB Smart Chain | bnb |
137 | Polygon | matic |
8453 | Base | base |
5000 | Mantle | mnt |
43114 | Avalanche | Avalanche |
42161 | Arbitrum One | arb1 |
1868 | Soneium | soneium |