Get NFT holdings (ERC721 + ERC1155)
https://api.triport.io/v1/polygon/wallet/nfts/0x5e8f0bcd1b2c3d4e5f60718293a4b5c6d7e8f901?limit=50&offset=0Returns the ERC721 and ERC1155 NFTs held by a Polygon address, with per-asset metadata, paged with `limit`/`offset`.
Lists the non-fungible tokens (NFTs) owned by a single Polygon address. Both
token standards are returned in one array: ERC721 (unique, single-owner
tokens) and ERC1155 (semi-fungible tokens that can be held in quantity). For
ERC1155 assets the held quantity is reported in the amount field; for ERC721
assets amount is omitted or "1".
Each entry carries available metadata — name, image_uri, and
collection_name — alongside the on-chain identity (contract + token_id).
Metadata fields are best-effort: an NFT whose metadata is unindexed or
unreachable will still appear with its contract, token_id, and standard,
but may omit the descriptive fields.
Results are paged with limit and offset. Use this endpoint to render a
wallet's NFT gallery or to reconcile holdings for a known address. The address
is treated read-only; no signing or authentication of the wallet is required —
only your Triport API key.
Parameters
Path parameters
addressstringrequired0x-prefixed, 40 hex chars (Ethereum-compatible format). Pattern: ^0x[0-9a-fA-F]{40}$.Query parametersobjectlimitintegeroptional1, max 1000, default 50.offsetintegeroptional0, default 0.Response
Response fields
| Field | Type | Description |
|---|---|---|
address | string | The address that was queried (echoed back). |
assets | array | List of PolyNftSummary objects (see below). |
pagination | object | Paging envelope: limit, offset, and optionally total. |
assets[] — PolyNftSummary
| Field | Type | Required | Description |
|---|---|---|---|
contract | string | yes | NFT contract address (0x-prefixed). |
token_id | string | yes | Token identifier. String-encoded to safely carry values beyond 2⁵³. |
standard | string | yes | Token standard: ERC721 or ERC1155. |
amount | string | no | Quantity held. Meaningful for ERC1155; for ERC721 this is "1" or omitted. |
name | string | no | Display name of the NFT, when indexed. |
image_uri | string (uri) | no | Media URI for the NFT, when available. |
collection_name | string | no | Name of the collection the NFT belongs to, when known. |
pagination
| Field | Type | Required | Description |
|---|---|---|---|
limit | integer | yes | Page size used (1–1000, default 50). |
offset | integer | yes | Offset applied (≥ 0, default 0). |
total | integer | no | Total assets available. Absent when too expensive to compute. |
Errors
All errors use the shared envelope (error, message, request_id). See
errors.md for the full envelope and error-code reference.
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthorized / trial_expired / subscription_expired | Missing or invalid API key, or the account's trial/subscription has lapsed. |
403 | tier_insufficient / method_unknown | The account's tier is below pro. The body includes current_tier, required_tier, and upgrade_url; the X-Required-Tier header is also set. |
429 | rate_limited | Sustained RPS for the polygon_wallet category exceeded. Honor the Retry-After and X-RateLimit-* headers before retrying. |
Examples
JavaScript (fetch)
const address = "0x5e8f0bcd1b2c3d4e5f60718293a4b5c6d7e8f901";
const url = `https://api.triport.io/v1/polygon/wallet/nfts/${address}?limit=50&offset=0`;
const res = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
});
if (!res.ok) throw new Error(`${res.status}: ${(await res.json()).message}`);
const { assets, pagination } = await res.json();
console.log(`${assets.length} NFTs (offset ${pagination.offset})`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const { assets, pagination } = await triport.polygon.wallet.nfts({
address: "0x5e8f0bcd1b2c3d4e5f60718293a4b5c6d7e8f901",
limit: 50,
offset: 0,
});
for (const nft of assets) {
console.log(`${nft.standard} ${nft.collection_name ?? "?"} #${nft.token_id}`);
}Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
page = client.polygon.wallet.nfts(
address="0x5e8f0bcd1b2c3d4e5f60718293a4b5c6d7e8f901",
limit=50,
offset=0,
)
for nft in page.assets:
qty = f" x{nft.amount}" if nft.standard == "ERC1155" else ""
print(f"{nft.standard} {nft.contract} #{nft.token_id}{qty}")Notes
- Pagination: request successive pages by advancing
offsetin steps oflimituntil fewer thanlimitassets are returned. When present, compareoffset + len(assets)againstpagination.total;totalmay be absent when it is expensive to compute, so do not rely on it being set. - ERC721 vs ERC1155: branch on the
standardfield. Readamountonly forERC1155assets; forERC721the quantity is implicitly one. - Token IDs are strings.
token_idandamountare string-encoded to preserve precision beyond JavaScript's safe-integer range — parse as BigInt where you need arithmetic. - Best-effort metadata.
name,image_uri, andcollection_namemay be absent when an asset is unindexed; always handle the missing case in your UI. - Related: see the other Polygon wallet endpoints for balances, token
holdings, and transaction history under
/v1/polygon/wallet/.