Hedera · Example Payload

Getnftsbyaccountid

Returns information for all non-fungible tokens for an account. ## Ordering When considering NFTs, their order is governed by a combination of their numerical **token.Id** and **serialnumber** values, with **token.id** being the parent column. A serialnumbers value governs its order within the given token.id In that regard, if a user acquired a set of NFTs in the order (2-2, 2-4 1-5, 1-1, 1-3, 3-3, 3-4), the following layouts illustrate the ordering expectations for ownership listing 1. **All NFTs in ASC order**: 1-1, 1-3, 1-5, 2-2, 2-4, 3-3, 3-4 2. **All NFTs in DESC order**: 3-4, 3-3, 2-4, 2-2, 1-5, 1-3, 1-1 3. **NFTs above 1-1 in ASC order**: 1-3, 1-5, 2-2, 2-4, 3-3, 3-4 4. **NFTs below 3-3 in ASC order**: 1-1, 1-3, 1-5, 2-2, 2-4 5. **NFTs between 1-3 and 3-3 inclusive in DESC order**: 3-4, 3-3, 2-4, 2-2, 1-5, 1-3 Note: The default order for this API is currently DESC ## Filtering When filtering there are some restrictions enforced to ensure correctness and scalability. **The table below defines the restrictions and support for the NFT ownership endpoint** | Query Param | Comparison Operator | Support | Description | Example | | ------------- | ------------------- | ------- | --------------------- | ------- | | token.id | eq | Y | Single occurrence only. | ?token.id=X | | | ne | N | | | | | lt(e) | Y | Single occurrence only. | ?token.id=lte:X | | | gt(e) | Y | Single occurrence only. | ?token.id=gte:X | | serialnumber | eq | Y | Single occurrence only. Requires the presence of a **token.id** query | ?serialnumber=Y | | | ne | N | | | | | lt(e) | Y | Single occurrence only. Requires the presence of an **lte** or **eq** **token.id** query | ?token.id=lte:X&serialnumber=lt:Y | | | gt(e) | Y | Single occurrence only. Requires the presence of an **gte** or **eq** **token.id** query | ?token.id=gte:X&serialnumber=gt:Y | | spender.id | eq | Y | | ?spender.id=Z | | | ne | N | | | | | lt(e) | Y | | ?spender.id=lt:Z | | | gt(e) | Y | | ?spender.id=gt:Z | Note: When searching across a range for individual NFTs a **serialnumber** with an additional **token.id** query filter must be provided. Both filters must be a single occurrence of **gt(e)** or **lt(e)** which provide a lower and or upper boundary for search.

accounts

Getnftsbyaccountid is an example object payload from Hedera, with 8 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

operationIdmethodpathsummarydescriptiontagsparametersresponses

Example Payload

Raw ↑
{
  "operationId": "getNftsByAccountId",
  "method": "GET",
  "path": "/api/v1/accounts/{idOrAliasOrEvmAddress}/nfts",
  "summary": "Get nfts for an account info",
  "description": "Returns information for all non-fungible tokens for an account.\n\n## Ordering\nWhen considering NFTs, their order is governed by a combination of their numerical **token.Id** and **serialnumber** values, with **token.id** being the parent column.\nA serialnumbers value governs its order within the given token.id\n\nIn that regard, if a user acquired a set of NFTs in the order (2-2, 2-4 1-5, 1-1, 1-3, 3-3, 3-4), the following layouts illustrate the ordering expectations for ownership listing\n1. **All NFTs in ASC order**: 1-1, 1-3, 1-5, 2-2, 2-4, 3-3, 3-4\n2. **All NFTs in DESC order**: 3-4, 3-3, 2-4, 2-2, 1-5, 1-3, 1-1\n3. **NFTs above 1-1 in ASC order**: 1-3, 1-5, 2-2, 2-4, 3-3, 3-4\n4. **NFTs below 3-3 in ASC order**: 1-1, 1-3, 1-5, 2-2, 2-4\n5. **NFTs between 1-3 and 3-3 inclusive in DESC order**: 3-4, 3-3, 2-4, 2-2, 1-5, 1-3\n\nNote: The default order for this API is currently DESC\n\n## Filtering\nWhen filtering there are some restrictions enforced to ensure correctness and scalability.\n\n**The table below defines the restrictions and support for the NFT ownership endpoint**\n\n| Query Param   | Comparison Operator | Support | Description           | Example |\n| ------------- | ------------------- | ------- | --------------------- | ------- |\n| token.id      | eq                  | Y       | Single occurrence only. | ?token.id=X |\n|               | ne                  | N       | | |\n|               | lt(e)               | Y       | Single occurrence only. | ?token.id=lte:X |\n|               | gt(e)               | Y       | Single occurrence only. | ?token.id=gte:X |\n| serialnumber  | eq                  | Y       | Single occurrence only. Requires the presence of a **token.id** query | ?serialnumber=Y |\n|               | ne                  | N       | | |\n|               | lt(e)               | Y       | Single occurrence only. Requires the presence of an **lte** or **eq** **token.id** query | ?token.id=lte:X&serialnumber=lt:Y |\n|               | gt(e)               | Y       | Single occurrence only. Requires the presence of an **gte** or **eq** **token.id** query | ?token.id=gte:X&serialnumber=gt:Y |\n| spender.id    | eq                  | Y       | | ?spender.id=Z |\n|               | ne                  | N       | | |\n|               | lt(e)               | Y       | | ?spender.id=lt:Z |\n|               | gt(e)               | Y       | | ?spender.id=gt:Z |\n\nNote: When searching across a range for individual NFTs a **serialnumber** with an additional **token.id** query filter must be provided.\nBoth filters must be a single occurrence of **gt(e)** or **lt(e)** which provide a lower and or upper boundary for search.\n",
  "tags": [
    "accounts"
  ],
  "parameters": [
    {
      "name": "idOrAliasOrEvmAddress",
      "in": "path",
      "description": "Account alias or account id or evm address",
      "required": true
    },
    {
      "name": "limit",
      "in": "query",
      "description": "The maximum number of items to return",
      "required": false
    },
    {
      "name": "order",
      "in": "query",
      "description": "The order in which items are listed",
      "required": false
    },
    {
      "name": "serialnumber",
      "in": "query",
      "description": "The nft serial number (64 bit type). Requires a tokenId value also be populated.",
      "required": false
    },
    {
      "name": "spender.id",
      "in": "query",
      "description": "The ID of the spender to return information for",
      "required": false
    },
    {
      "name": "token.id",
      "in": "query",
      "description": "The ID of the token to return information for",
      "required": false
    }
  ],
  "responses": {
    "200": "OK",
    "400": "Invalid parameter",
    "404": "Not Found"
  }
}