Get non-fungible token holdings
Retrieves a list of non-fungible tokens owned by the given principal (STX address or smart contract ID).
Query Parameters
principalSTX Address & Smart Contract ID
asset_identifiers?array<string>
limit?Limit
max number of tokens to fetch
Default
50
Range
value <= 200
offset?Offset
index of first tokens to fetch
Default
0
tx_metadataboolean
whether or not to include the complete transaction metadata instead of just tx_id
. Enabling this option can affect performance and response times.
Default
false
Response Body
List of Non-Fungible Token holdings
TypeScript Definitions
Use the response body type in TypeScript.
limitinteger
offsetinteger
totalinteger
resultsarray<NonFungibleTokenHoldingsList>
Default Response
TypeScript Definitions
Use the response body type in TypeScript.
errorstring
message?string
[key: string]any
curl -X GET "https://api.hiro.so//extended/v1/tokens/nft/holdings?principal=SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP&asset_identifiers=SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy%3A%3Acandy&limit=50&offset=0&tx_metadata=false"
fetch("https://api.hiro.so//extended/v1/tokens/nft/holdings?principal=SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP&asset_identifiers=SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy%3A%3Acandy&limit=50&offset=0&tx_metadata=false")
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.hiro.so//extended/v1/tokens/nft/holdings?principal=SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP&asset_identifiers=SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy%3A%3Acandy&limit=50&offset=0&tx_metadata=false"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://api.hiro.so//extended/v1/tokens/nft/holdings?principal=SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP&asset_identifiers=SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy%3A%3Acandy&limit=50&offset=0&tx_metadata=false"
response = requests.request("GET", url)
print(response.text)
{
"limit": 20,
"offset": 0,
"total": 1,
"results": [
{
"asset_identifier": "string",
"value": {
"hex": "string",
"repr": "string"
},
"block_height": 0,
"tx_id": "string"
}
]
}
{
"error": "string",
"message": "string"
}