| title | Solana DAS API: Unified NFT and Token Data Access |
|---|---|
| sidebarTitle | Overview |
| description | The most comprehensive Solana API for NFTs, compressed NFTs, and tokens. Unified interface for all digital assets with high performance and complete metadata. |
The Digital Asset Standard (DAS) API is an open-source specification that provides a unified interface for interacting with all types of digital assets on Solana:
- Regular NFTs (Non-Fungible Tokens)
- Compressed NFTs (State Compression)
- Fungible Tokens (including SPL Tokens and Token-2022)
- Inscriptions and SPL-20 tokens (experimental)
These methods let you retrieve detailed information about specific assets by their IDs.
```typescript // Get a single asset by its ID const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;const getAsset = async (id) => {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: "my-request-id",
method: "getAsset",
params: {
id: id,
},
}),
});
const data = await response.json();
return data.result;
};
// Example usage
getAsset("FNt6A9Mfnqbwc1tY7uwAguKQ1JcpBrxmhczDgbdJy5AC");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getasset">
View detailed documentation for getAsset
</Card>
const getAssetBatch = async (ids) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetBatch',
params: {
ids: ids
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetBatch([
'81bxPqYCE8j34nQm7Rooqi8Vt3iMHLzgZJ71rUVbQQuz',
'CWHuz6GPjWYdwt7rTfRHKaorMwZP58Spyd7aqGK7xFbn'
]);
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetbatch">
View detailed documentation for getAssetBatch
</Card>
const getAssetProof = async (id) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetProof',
params: {
id: id
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetProof("Bu1DEKeawy7txbnCEJE4BU3BKLXaNAKCYcHR4XhndGss");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetproof">
View detailed documentation for getAssetProof
</Card>
const getAssetProofBatch = async (ids) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetProofBatch',
params: {
ids: ids
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetProofBatch([
'81bxPqYCE8j34nQm7Rooqi8Vt3iMHLzgZJ71rUVbQQuz',
'CWHuz6GPjWYdwt7rTfRHKaorMwZP58Spyd7aqGK7xFbn'
]);
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetproofbatch">
View detailed documentation for getAssetProofBatch
</Card>
These methods allow you to retrieve assets based on ownership, creation, authority, or collection membership.
All pagination in DAS API methods starts at 1 (not 0). ```typescript // Get all assets owned by a wallet address const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;const getAssetsByOwner = async (ownerAddress) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetsByOwner',
params: {
ownerAddress: ownerAddress,
page: 1,
limit: 1000,
displayOptions: {
showFungible: true, // Include SPL tokens
showNativeBalance: true, // Include SOL balance
showInscription: true, // Include inscription data
},
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetsByOwner("86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetsbyowner">
View detailed documentation for getAssetsByOwner
</Card>
const getAssetsByGroup = async (collectionAddress) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetsByGroup',
params: {
groupKey: 'collection',
groupValue: collectionAddress,
page: 1,
limit: 1000,
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetsByGroup("J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetsbygroup">
View detailed documentation for getAssetsByGroup
</Card>
const getAssetsByCreator = async (creatorAddress) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetsByCreator',
params: {
creatorAddress: creatorAddress,
onlyVerified: true,
page: 1,
limit: 1000,
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetsByCreator("D3XrkNZz6wx6cofot7Zohsf2KSsu2ArngNk8VqU9cTY3");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetsbycreator">
View detailed documentation for getAssetsByCreator
</Card>
const getAssetsByAuthority = async (authorityAddress) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetsByAuthority',
params: {
authorityAddress: authorityAddress,
page: 1,
limit: 1000,
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getAssetsByAuthority("2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getassetsbyauthority">
View detailed documentation for getAssetsByAuthority
</Card>
These methods allow for more specialized asset queries, including transaction history, NFT editions, and complex search filters.
```typescript // Search for assets with flexible criteria const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;const searchAssets = async (searchParams) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'searchAssets',
params: searchParams,
}),
});
const { result } = await response.json();
return result;
};
// Example: Search for NFTs in a collection
searchAssets({
ownerAddress: "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY",
grouping: ["collection", "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"],
limit: 100
});
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/searchassets">
View detailed documentation for searchAssets
</Card>
const getSignaturesForAsset = async (assetId) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getSignaturesForAsset',
params: {
id: assetId,
page: 1,
limit: 1000,
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getSignaturesForAsset("FNt6A9Mfnqbwc1tY7uwAguKQ1JcpBrxmhczDgbdJy5AC");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getsignaturesforasset">
View detailed documentation for getSignaturesForAsset
</Card>
const getNftEditions = async (masterMint) => {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: "my-request-id",
method: "getNftEditions",
params: {
mint: masterMint,
page: 1,
limit: 100
},
}),
});
const { result } = await response.json();
return result;
};
// Example usage
getNftEditions("Ey2Qb8kLctbchQsMnhZs5DjY32To2QtPuXNwWvk4NosL");
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getnfteditions">
View detailed documentation for getNftEditions
</Card>
const getTokenAccounts = async (params) => {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: "my-request-id",
method: "getTokenAccounts",
params: params,
}),
});
const { result } = await response.json();
return result;
};
// Example: Get all accounts holding a specific token
getTokenAccounts({
mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC
page: 1,
limit: 100
});
```
<Card title="API Reference" horizontal icon="code" href="/api-reference/das/gettokenaccounts">
View detailed documentation for getTokenAccounts
</Card>
// Get all tokens for a wallet including price data
const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;
const getTokensWithPrices = async (ownerAddress) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetsByOwner',
params: {
ownerAddress: ownerAddress,
displayOptions: {
showFungible: true,
},
},
}),
});
const { result } = await response.json();
// Filter tokens that have price data
const tokensWithPrices = result.items.filter(
asset => asset.token_info?.price_info
);
return tokensWithPrices;
};
// Example usage
getTokensWithPrices("86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY");State-compressed NFTs (cNFTs) require special handling for operations like retrieving Merkle proofs and transaction history.
const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;
const getCompressedNft = async (id) => {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAsset',
params: { id },
}),
});
const { result } = await response.json();
return result;
};Merkle proofs are required for verifying and performing on-chain operations with compressed NFTs like transfers and burns.
const getProof = async (id) => {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetProof',
params: { id },
}),
});
const { result } = await response.json();
return result;
};const getTransactionHistory = async (id) => {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getSignaturesForAsset',
params: {
id,
page: 1,
limit: 100
},
}),
});
const { result } = await response.json();
return result;
};// Get inscriptions for a wallet
const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;
const getInscriptionsForWallet = async (ownerAddress) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-request-id',
method: 'getAssetsByOwner',
params: {
ownerAddress: ownerAddress,
displayOptions: {
showInscription: true,
},
},
}),
});
const { result } = await response.json();
// Filter results to only include assets with inscription data
const inscriptions = result.items.filter(
asset => asset.inscription
);
return inscriptions;
};
// Example usage
getInscriptionsForWallet("6GmTFg5SCs4zGfDEidUAJjS5pSrXEPwW8Rpfs3RHrbc5");