API ReferenceToken APIGet Token BalancesGet Native & SPL Token Balance by WalletVersion: 2.2Get Wallet PortfolioGEThttps://solana-gateway.moralis.io/account/:network/:address/portfolioGets the portfolio for a given network and address.PATH PARAMSnetworkstringrequiredThe network to querymainnetdevnetaddressstringrequiredThe address of the token contractQUERY PARAMSnftMetadatabooleanShould NFT metadata be included in the result?falsetrueResponses200 Returns the complete portfolio of the wallet address, including native balance, tokens, and NFTsobject400 Bad request. Invalid address or other request error.objectAPI KEYTest Live APINode.jsPythoncURLGoPHPimport Moralis from 'moralis';try { await Moralis.start({ apiKey: "YOUR_API_KEY" }); const response = Moralis.SolApi.account.getPortfolio({ "nftMetadata": true, "network": "mainnet", "address": "kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs" }); console.log(response.raw);} catch (e) { console.error(e);}from moralis import sol_apiapi_key = "YOUR_API_KEY"params = { "nft_metadata": True, "network": "mainnet", "address": "kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs"}result = sol_api.account.get_portfolio( api_key=api_key, params=params,)print(result)curl --request GET \ --url 'https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/portfolio?nftMetadata=true' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/portfolio?nftMetadata=true" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/portfolio?nftMetadata=true', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 Returns the complete portfolio of the wallet address, including native balance, tokens, and NFTs400 Bad request. Invalid address or other request error.{ "nativeBalance": { "lamports": "18610324351", "solana": "18.610324351" }, "tokens": [ { "associatedTokenAddress": "BxemX7FdJo5msrC3aBi6JNafRjS2MfdmYcVr3yFPFvKn", "mint": "5ykhiPoUTcoqpieSnQ6w2tPbCERJawe9kAM6MuZJMcbP", "amountRaw": "3387402990000", "amount": "3387402.99", "decimals": 6, "name": "onchain dog ", "symbol": "OCD", "logo": "https://logo.moralis.io/solana-mainnet_5ykhiPoUTcoqpieSnQ6w2tPbCERJawe9kAM6MuZJMcbP_0442d558f20da42a000ba4469d8b7046.png", "isVerifiedContract": "" } ], "nfts": [ { "associatedTokenAddress": "FH1D4qJ6nC2ng5UjZW6q36R98wRidb5vF6Js93khzSj6", "mint": "71P6frZcEbQxT7WEKxPoySNCmRh4MGbjpLT8r6zXg4Bt", "name": "goose #720", "symbol": "goose", "decimals": "", "amount": "1", "amountRaw": "1", "totalSupply": "1", "attributes": [ { "traitType": "Background", "value": "Yellow" } ], "contract": { "type": "non-fungible-programmable", "name": "gooses", "symbol": "goose" }, "collection": { "collectionAddress": "6ubyyuUz3EVFwZrBh3C2ezSXXfyjxP4jhemLPyGgdL6Y", "name": "gooses", "description": "gooses for you to collect and enjoy!", "imageOriginalUrl": "https://gateway.pinit.io/ipfs/QmeBKjawYwSA6QLX8NqPq722eEHCroLumw2G7WxNqWdyG7/720", "externalUrl": "", "metaplexMint": "6ubyyuUz3EVFwZrBh3C2ezSXXfyjxP4jhemLPyGgdL6Y", "sellerFeeBasisPoints": "" }, "firstCreated": { "mintTimestamp": 1705370276, "mintBlockNumber": 242073688, "mintTransaction": "3t8aEZdN2fpEWcLsEaxdYyVD8orisyi4vY839HDfdWHg9PFaJvRPxbB8Z8oYRgjiTLdKJPzfLnBdgx7WQijiGvpA" }, "creators": [ { "address": "AYKFGxeow8mXf3TyANdsm2QyUQndk1Gwo78VxyEv5hQD", "share": "", "verified": true } ], "properties": { "files": [ { "uri": "https://gateway.pinit.io/ipfs/QmeBKjawYwSA6QLX8NqPq722eEHCroLumw2G7WxNqWdyG7/720", "type": "image/jpeg" } ], "category": "image", "creators": [ { "address": "5Le4teStdGbdUEcbaDQYDjZ1UZQFX5KJbYr57jhJg8jf", "share": 100 } ] }, "media": { "status": "success", "mimetype": "image/jpeg", "originalMediaUrl": "https://gateway.pinit.io/ipfs/QmeBKjawYwSA6QLX8NqPq722eEHCroLumw2G7WxNqWdyG7/720", "updatedAt": "2025-04-24T10:19:31.683Z", "mediaCollection": { "low": { "height": 100, "width": 100, "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/solana/mainnet/71P6frZcEbQxT7WEKxPoySNCmRh4MGbjpLT8r6zXg4Bt/0x831a9883966f1fa6f03b0405cfc6f7523d66273e6a7b594de41ddb90688d7dd0/low.jpeg" }, "medium": { "height": 250, "width": 250, "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/solana/mainnet/71P6frZcEbQxT7WEKxPoySNCmRh4MGbjpLT8r6zXg4Bt/0x831a9883966f1fa6f03b0405cfc6f7523d66273e6a7b594de41ddb90688d7dd0/medium.jpeg" }, "high": { "height": 500, "width": 500, "url": "https://nft-preview-media.s3.us-east-1.amazonaws.com/solana/mainnet/71P6frZcEbQxT7WEKxPoySNCmRh4MGbjpLT8r6zXg4Bt/0x831a9883966f1fa6f03b0405cfc6f7523d66273e6a7b594de41ddb90688d7dd0/high.jpeg" } } } } ]}