# Filtering

REST and WebSocket API endpoints that return multiple results may provide possibility to filter the data by certain properties. Not all properties can be used as filters. Please check the endpoint documentation to find out what properties are available for filtering.

## Requests

To filter the results by a property, the corresponding property should be provided as a query param. Multiply filters can be used in one request to narrow down the data to what fits your dApp use-case. Some filters can accept multiple values separated by a comma.

## Example

Filter NFT tokens by owner and contract package:

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

```json
{
  "data": [
    {
      "contract_package_hash": "998af6825d77da15485baf4bb89aeef3f1dfb4a78841d149574b0be694ce4821",
      "is_burned": false,
      "offchain_metadata": null,
      "offchain_metadata_status": 0,
      "onchain_metadata": "eyJuYW1lIjogIlF1aWV0IHBsYWNlcyIsICJhc3NldCI6ICJodHRwczovL21hcml0aW1lLnNlYWxzdG9yYWdlLmlvL21ha2UvOTk4YWY2ODI1ZDc3ZGExNS9iMzQ0NzhkMzkyNjY0OGEyODkzZWNlM2NiNzJiMGIwMSIsICJkZXNjcmlwdGlvbiI6ICJhIGxvZnQgIn0=",
      "owner_hash": "8c9675894eb753007c17058b4616dee224171365f0ac5e161152b1e5c95ce944",
      "owner_type": 0,
      "timestamp": "2022-12-06T18:41:41Z",
      "token_id": "13",
      "token_standard_id": 1,
      "tracking_id": 21455
    },
    {
      "contract_package_hash": "998af6825d77da15485baf4bb89aeef3f1dfb4a78841d149574b0be694ce4821",
      "is_burned": false,
      "offchain_metadata": null,
      "offchain_metadata_status": 0,
      "onchain_metadata": "eyJuYW1lIjogImxpYnJhcnkiLCAiYXNzZXQiOiAiaHR0cHM6Ly9tYXJpdGltZS5zZWFsc3RvcmFnZS5pby9tYWtlLzk5OGFmNjgyNWQ3N2RhMTUvNTQ0ZjI5ZDJiOTZmNDc1ZjhmYWMwMmJmMzY5ZWM2MGUiLCAiZGVzY3JpcHRpb24iOiAiYW5vdGhlciBjb29sIHF1aWV0IHBsYWNlIn0=",
      "owner_hash": "8c9675894eb753007c17058b4616dee224171365f0ac5e161152b1e5c95ce944",
      "owner_type": 0,
      "timestamp": "2022-12-06T18:44:45Z",
      "token_id": "14",
      "token_standard_id": 1,
      "tracking_id": 21456
    }
  ],
  "item_count": 2,
  "page_count": 1
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cspr.cloud/1.5.x/documentation/overview/filtering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
