Get NFTs
curl --request GET \
--url https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts', 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://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"nftId": "ethereum.0x123abc...def456.1234",
"name": "Cosmic Kitty #1234",
"description": "A rare, interstellar feline NFT from the Cosmic Kitties collection.",
"imageUrl": "https://example.com/images/cosmic-kitty-1234.png",
"chainId": "eip155:1",
"contractAddress": "0x123abc...def456",
"tokenId": "1234",
"collection": {
"name": "Cosmic Kitties",
"description": "A collection of 10,000 unique space-faring felines.",
"imageUrl": "https://example.com/images/cosmic-kitties-logo.png"
}
}
]{
"error": "<string>"
}{
"error": "<string>"
}Wallet Metadata
Get NFTs
Retrieves the NFTs held by a specified client on a given blockchain.
GET
/
custodians
/
me
/
clients
/
{clientId}
/
chains
/
{chain}
/
assets
/
nfts
Get NFTs
curl --request GET \
--url https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts', 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://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/custodians/me/clients/{clientId}/chains/{chain}/assets/nfts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"nftId": "ethereum.0x123abc...def456.1234",
"name": "Cosmic Kitty #1234",
"description": "A rare, interstellar feline NFT from the Cosmic Kitties collection.",
"imageUrl": "https://example.com/images/cosmic-kitty-1234.png",
"chainId": "eip155:1",
"contractAddress": "0x123abc...def456",
"tokenId": "1234",
"collection": {
"name": "Cosmic Kitties",
"description": "A collection of 10,000 unique space-faring felines.",
"imageUrl": "https://example.com/images/cosmic-kitties-logo.png"
}
}
]{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Portal API Key (Custodian API Key). Pass as a Bearer token in the Authorization header.
Path Parameters
The unique identifier of the client.
The blockchain chain identifier. Use either a friendly name or CAIP-2 format.
When using CAIP-2 format in URLs, ensure the colon (:) is URI-encoded as %3A.
Supported chains:
ethereum(eip155:1)sepolia(eip155:11155111)base(eip155:8453)base-sepolia(eip155:84532)polygon(eip155:137)polygon-amoy(eip155:80002)celo(eip155:42220)celo-alfajores(eip155:44787)monad(eip155:143)monad-testnet(eip155:10143)solana(solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)solana-devnet(solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)tron(tron:mainnet)tron-nile(tron:nile)tron-shasta(tron:shasta)stellar(stellar:pubnet)stellar-testnet(stellar:testnet)bitcoin-segwit(bip122:000000000019d6689c085ae165831e93-p2wpkh)bitcoin-segwit-testnet(bip122:000000000933ea01ad0ee984209779ba-p2wpkh)
Response
NFTs retrieved successfully
Was this page helpful?