代币与 NFT (DAS)
getAssetsByGroup
检索特定集合或组中的所有 Solana NFT 和压缩 NFT,支持灵活的分组键和分页
POST
/
getAssetsByGroup
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getAssetsByGroup",
"params": {
"groupKey": "collection",
"groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"
}
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getAssetsByGroup",
"params": {
"groupKey": "collection",
"groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'getAssetsByGroup',
params: {
groupKey: 'collection',
groupValue: 'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w'
}
})
};
fetch('https://mainnet.helius-rpc.com/?api-key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.helius-rpc.com/?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'getAssetsByGroup',
'params' => [
'groupKey' => 'collection',
'groupValue' => 'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mainnet.helius-rpc.com/?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssetsByGroup\",\n \"params\": {\n \"groupKey\": \"collection\",\n \"groupValue\": \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mainnet.helius-rpc.com/?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssetsByGroup\",\n \"params\": {\n \"groupKey\": \"collection\",\n \"groupValue\": \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssetsByGroup\",\n \"params\": {\n \"groupKey\": \"collection\",\n \"groupValue\": \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"result": {
"last_indexed_slot": 365750752,
"total": 1,
"limit": 1,
"page": 1,
"items": [
{
"interface": "ProgrammableNFT",
"is_agent": true,
"agent_token": "<string>",
"asset_signer": "<string>",
"plugins": {},
"id": "JEGruwYE13mhX2wi2MGrPmeLiVyZtbBptmVy9vG3pXRC",
"authorities": "<array>",
"compression": {},
"grouping": "<array>",
"royalty": {},
"creators": "<array>",
"ownership": {},
"supply": {},
"mutable": true,
"burnt": false
}
]
}
}{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "请求参数无效。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "身份验证失败。缺少或无效的API密钥。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "您没有权限访问此资源。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32004,
"message": "未找到指定组的资产。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32029,
"message": "超出速率限制。请稍后再试。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "服务器发生了意外错误。"
},
"id": "1"
}请求参数
string
必填
搜索的 Solana 组分类类型(例如,‘collection’,‘community’,‘creator’等)。
string
必填
要检索所有匹配 NFT 的 Solana 集合地址或组标识符。
number
用于在 Solana 集合结果中进行分页的页码。
number
每次请求中从该集合返回的 Solana NFT 的最大数量。
object
响应的排序选项。
string
检索到的 Solana 集合中的 NFT 将根据此标准进行排序。
createdrecent_actionupdatednone
string
检索到的 Solana 集合中的 NFT 将根据此方向进行排序。
ascdesc
string
用于向后分页浏览资产的游标。
string
用于向前分页浏览资产的游标。
object
响应的显示选项。
boolean
默认值:"false"
显示未验证集合的分组信息,而不是跳过它们。
boolean
默认值:"false"
显示集合的元数据。
boolean
默认值:"false"
显示匹配查询的资产总数。这将使请求速度变慢。
请求体
application/json
此页面对您有帮助吗?
⌘I
getAssetsByGroup
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getAssetsByGroup",
"params": {
"groupKey": "collection",
"groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"
}
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getAssetsByGroup",
"params": {
"groupKey": "collection",
"groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'getAssetsByGroup',
params: {
groupKey: 'collection',
groupValue: 'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w'
}
})
};
fetch('https://mainnet.helius-rpc.com/?api-key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.helius-rpc.com/?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'getAssetsByGroup',
'params' => [
'groupKey' => 'collection',
'groupValue' => 'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mainnet.helius-rpc.com/?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssetsByGroup\",\n \"params\": {\n \"groupKey\": \"collection\",\n \"groupValue\": \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mainnet.helius-rpc.com/?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssetsByGroup\",\n \"params\": {\n \"groupKey\": \"collection\",\n \"groupValue\": \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssetsByGroup\",\n \"params\": {\n \"groupKey\": \"collection\",\n \"groupValue\": \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"result": {
"last_indexed_slot": 365750752,
"total": 1,
"limit": 1,
"page": 1,
"items": [
{
"interface": "ProgrammableNFT",
"is_agent": true,
"agent_token": "<string>",
"asset_signer": "<string>",
"plugins": {},
"id": "JEGruwYE13mhX2wi2MGrPmeLiVyZtbBptmVy9vG3pXRC",
"authorities": "<array>",
"compression": {},
"grouping": "<array>",
"royalty": {},
"creators": "<array>",
"ownership": {},
"supply": {},
"mutable": true,
"burnt": false
}
]
}
}{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "请求参数无效。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "身份验证失败。缺少或无效的API密钥。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "您没有权限访问此资源。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32004,
"message": "未找到指定组的资产。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32029,
"message": "超出速率限制。请稍后再试。"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "服务器发生了意外错误。"
},
"id": "1"
}