# Get NFTs

Get a paginated list of NFTs.

```
GET /nft-tokens
```

## Query params

| Query param             | Description                                                                                                                               |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `owner_hash`            | Owner hash filter                                                                                                                         |
| `contract_package_hash` | Contract package hash filter                                                                                                              |
| `from_block_height`     | From block height range                                                                                                                   |
| `to_block_height`       | To block height range                                                                                                                     |
| `is_burned`             | Filters tokens by their is\_burned status: `false` to get active NFTs, `true` to get the burned ones. By default all tokens are returned. |

## Sorting

| Property    | Description              |
| ----------- | ------------------------ |
| `token_id`  | Sort tokens by token\_id |
| `timestamp` | Sort tokens by timestamp |

Default sorting is `timestamp DESC`

## Optional properties

| Property                         | Type                                                                                                                                                                  | Description                                                                                                       |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `contract_package`               | [`ContractPackage`](https://docs.cspr.cloud/rest-api/contract-package)                                                                                                | NFT contract package                                                                                              |
| `owner_public_key`               | `string(68)`                                                                                                                                                          | Owner public key if it's an account                                                                               |
| `owner_account_info`             | [`AccountInfo`](https://github.com/make-software/casper-middleware/blob/documentation/docs/public/rest-api/non-fungible-token/account-info.md)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the token owner account |
| `owner_centralized_account_info` | [`CentralizedAccountInfo`](https://github.com/make-software/casper-middleware/blob/documentation/docs/public/rest-api/non-fungible-token/centralized-account-info.md) | Account information available for known accounts provided by CSPR.cloud team                                      |
| `owner_cspr_name`                | `string`                                                                                                                                                              | Primary CSPR.name of the owner account                                                                            |
| `cspr_name_resolutions`          | [`CSPRNameResolution[]`](https://github.com/make-software/casper-middleware/blob/documentation/docs/public/rest-api/non-fungible-token/cspr-name-resolution.md)       | Associated CSPR.name token resolutions (in case NFT is a CSPR.name token)                                         |

## Response

[`PaginatedResponse`](https://docs.cspr.cloud/documentation/overview/pagination)[`<NFTToken>`](https://docs.cspr.cloud/rest-api/non-fungible-token)

## Example

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/nft-tokens?owner_hash=8e09f028baff4e3a851e70bb8a5dc02eae7f8cb7faf1b52d9c8dafa7f41fa55c' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": [
    {
      "contract_package_hash": "006c68af5f767e406cccd326f8d8bba81dec20d2578f308d33e3bbf08ee5d383",
      "block_height": 1461592,
      "is_burned": false,
      "offchain_metadata": null,
      "offchain_metadata_status": 3,
      "onchain_metadata": {
        "token_uri": "{\"token_uri\":\"ipfs://QmZa1hrX5FJRxyNyEbYjTVPJ6mbQtA3wJu1RjQpv9am6n2\"}"
      },
      "owner_hash": "8e09f028baff4e3a851e70bb8a5dc02eae7f8cb7faf1b52d9c8dafa7f41fa55c",
      "owner_type": 1,
      "timestamp": "2022-10-18T15:22:06Z",
      "token_id": "0",
      "token_standard_id": 1,
      "tracking_id": 20458
    }
  ],
  "item_count": 1,
  "page_count": 1
}
```
