getAssetsByGroup
https://api.triport.io/solLook up every Digital Asset Standard (DAS) asset that belongs to a group — most commonly all NFTs in a collection.
getAssetsByGroup is a Digital Asset Standard (DAS) read method. Given a
group key and value, it returns every asset assigned to that group. By far the
most common use is enumerating an NFT collection: pass the group key
collection and the collection's mint address to page through all assets that
belong to it.
This is a basic-tier method. DAS methods (category sol_das) are not
available on the free tier — calling them with a free-tier key returns a
tier_insufficient error (see Errors). Upgrade to basic or
higher to use it.
Because the result set for a popular collection can be large, the method is
paginated. Request one page at a time and continue until a page returns fewer
items than your requested limit.
Parameters
DAS methods take a single object parameter (named-object form). The intended fields are:
groupKeystringrequired"collection".groupValuestringrequiredcollection, the collection mint address (base-58).pageintegeroptional1.limitintegeroptional1000.sortByobjectoptional{ "sortBy": "created", "sortDirection": "asc" }.before / afterstringoptionalpage.Response
A successful call returns a paginated list of assets:
result.totalintegerresult.limitintegerresult.pageintegerresult.itemsarrayresult.items[].idstringresult.items[].interfacestringV1_NFT.result.items[].groupingarraygroup_key / group_value.result.items[].ownershipobjectErrors
Errors are returned as a standard JSON-RPC error envelope. The cases most relevant to this method:
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient (HTTP 403) | Called with a free-tier key — getAssetsByGroup requires basic tier or higher. |
-32003 | rate_limited (HTTP 429) | Sustained RPS for the sol_das category exceeded; honor the Retry-After header. |
-32602 | Invalid params | groupKey / groupValue missing or malformed. |
-32601 | method_unknown (HTTP 403) | Method name misspelled or not part of the Solana product. |
Example tier_insufficient response (free tier calling a DAS method):
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32002,
"message": "Method 'getAssetsByGroup' requires basic tier or higher",
"data": {
"current_tier": "free",
"required_tier": "basic",
"method": "getAssetsByGroup",
"category": "sol_das",
"upgrade_url": "https://triport.io/upgrade/basic"
}
}
}See the Errors page for the full envelope and the typed error schemas.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/sol", {
method: "POST",
headers: {
"x-token": process.env.TRIPORT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getAssetsByGroup",
params: {
groupKey: "collection",
groupValue: "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
page: 1,
limit: 1000,
},
}),
});
const { result } = await res.json();
console.log(`page ${result.page}: ${result.items.length} assets`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const collection = "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w";
const page = await triport.sol.rpc("getAssetsByGroup", {
groupKey: "collection",
groupValue: collection,
page: 1,
limit: 1000,
});
console.log(`page ${page.page}: ${page.items.length} assets`);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
page = triport.sol.rpc("getAssetsByGroup", {
"groupKey": "collection",
"groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"page": 1,
"limit": 1000,
})
print(f"page {page['page']}: {len(page['items'])} assets")Notes
- Pagination. Keep incrementing
pageuntil a response returns fewer thanlimititems — that page is the last one. For large collections, prefer the cursor form (before/after) if you need stable iteration while the collection changes. - Tier gate. This is a
sol_dasmethod, so a basic-tier (or higher) key is required; free-tier keys get-32002. See Rate Limits for the per-tier RPS budget on thesol_dascategory. - Related DAS methods:
getAsset(single asset),getAssetProof(merkle proof for compressed assets), andgetAssetsByOwner(assets held by a wallet). - Schema finalization. This page documents the intended contract while the
method is a scaffold. When the
api.2.2+ schema lands, re-check parameter defaults and the full asset object shape against the updated reference.