getAssetsByGroup - Helius DAS API

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

POST

https://mainnet.helius-rpc.comhttps://devnet.helius-rpc.com

/

Try it

getAssetsByGroup

cURL
curl --request POST \
  --url 'https://mainnet.helius-rpc.com/?api-key=' \
  --header 'Content-Type: application/json' \
  --data '\n{\n  "jsonrpc": "2.0",\n  "id": "1",\n  "method": "getAssetsByGroup",\n  "params": {\n    "groupKey": "collection",\n    "groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",\n    "options": {\n      "showUnverifiedCollections": false,\n      "showCollectionMetadata": false,\n      "showGrandTotal": false\n    }\n  }\n}\n'
Python
import requests

url = "https://mainnet.helius-rpc.com/?api-key="

payload = {
    "jsonrpc": "2.0",
    "id": "1",
    "method": "getAssetsByGroup",
    "params": {
        "groupKey": "collection",
        "groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
        "options": {
            "showUnverifiedCollections": False,
            "showCollectionMetadata": False,
            "showGrandTotal": False
        }
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
JavaScript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getAssetsByGroup',
    params: {
      groupKey: 'collection',
      groupValue: 'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w',
      options: {
        showUnverifiedCollections: false,
        showCollectionMetadata: false,
        showGrandTotal: false
      }
    }
  })
};

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',\
        'options' => [\
                'showUnverifiedCollections' => false,\
                'showCollectionMetadata' => false,\
                'showGrandTotal' => false\
        ]\
    ]\
  ]),\
  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;
}
Go
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    \"options\": {\n      \"showUnverifiedCollections\": false,\n      \"showCollectionMetadata\": false,\n      \"showGrandTotal\": false\n    }\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))

}
Java
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    \"options\": {\n      \"showUnverifiedCollections\": false,\n      \"showCollectionMetadata\": false,\n      \"showGrandTotal\": false\n    }\n  }\n}")
  .asString();
Ruby
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    \"options\": {\n      \"showUnverifiedCollections\": false,\n      \"showCollectionMetadata\": false,\n      \"showGrandTotal\": false\n    }\n  }\n}"

response = http.request(request)
puts response.read_body

Response

Successful response

{
  "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
      }
    ]
  }
}

Error responses

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32602,
    "message": "Invalid request parameters."
  },
  "id": "1"
}
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32001,
    "message": "Authentication failed. Missing or invalid API key."
  },
  "id": "1"
}
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32003,
    "message": "You do not have permission to access this resource."
  },
  "id": "1"
}
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32004,
    "message": "No assets found for the specified group."
  },
  "id": "1"
}
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32029,
    "message": "Rate limit exceeded. Please try again later."
  },
  "id": "1"
}
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32000,
    "message": "An unexpected error occurred on the server."
  },
  "id": "1"
}

Request Parameters

groupKey

The Solana group classification type to search by (e.g., ‘collection’, ‘community’, ‘creator’, etc.).

groupValue

The Solana collection address or group identifier to retrieve all matching NFTs for.

page

The page number for paginating through the Solana collection results.

limit

The maximum number of Solana NFTs to return per request from this collection.

sortBy

The sorting options for the response.

sortBy.sortBy

The criteria by which the retrieved Solana NFTs in the collection will be sorted.

sortBy.sortDirection

The direction by which the retrieved Solana NFTs in the collection will be sorted.

before

The cursor for paginating backwards through the assets.

after

The cursor for paginating forwards through the assets.

options

The display options for the response.

options.showUnverifiedCollections

Displays grouping information for unverified collections instead of skipping them.

options.showCollectionMetadata

Displays metadata for the collection.

options.showGrandTotal

Shows the total number of assets that matched the query. This will make the request slower.

Authorizations

api-key

Your Helius API key. You can get one for free in the dashboard.

Body

jsonrpc

The version of the JSON-RPC protocol.

Available options:

id

An ID to identify the request.

method

The name of the DAS method to invoke.

Available options:

params

Show child attributes

Response

Successful response

jsonrpc

Example: "2.0"

result

Show child attributes