> For the complete documentation index, see [llms.txt](https://docs.hatsprotocol.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hatsprotocol.xyz/for-developers/v1-sdk/subgraph/misc.md).

# Misc

### <mark style="color:purple;">searchTreesHatsWearers</mark>

Search for a Hat, Tree or Wearer by ID.

```typescript
const res = await hatsSubgraphClient.searchTreesHatsWearers({
    chainId,
    search,
    treeProps,
    hatProps,
    wearerProps,
});
```

***Arguments***:

```typescript
{
    chainId: number;
    search: string;
    treeProps: TreePropsConfig;
    hatProps: HatPropsConfig;
    wearerProps: WearerPropsConfig;
}
```

* `chainId` - ID of the chain to fetch from.
* `search` - ID to search for (Hat ID or pretty ID, Tree ID or Wearer address).
* `treeProps` - Tree's properties to fetch, including the ones of nested objects. Check the [TreePropsConfig](/for-developers/v1-sdk/subgraph/types.md#treepropsconfig) type for the available properties and query filters.
* `hatProps` - Hat's properties to fetch, including the ones of nested objects. Check the [HatPropsConfig](/for-developers/v1-sdk/subgraph/types.md#hatpropsconfig) type for the available properties and query filters.
* `wearerProps` - Wearer's properties to fetch, including the ones of nested objects. Check the [WearerPropsConfig](/for-developers/v1-sdk/subgraph/types.md#wearerpropsconfig) type for the available properties and query filters.

***Response***:

```typescript
{ trees: Tree[]; hats: Hat[]; wearers: Wearer[] }
```

An object containing the search result.&#x20;

***Example:***

```typescript
// search for a given hat, tree or wearer.
// include only the object's ID in the reuslt 
const res = await client.searchTreesHatsWearers({
  chainId: 10,
  search: "0x0000000100020001000100000000000000000000000000000000000000000000",
  treeProps: {},
  hatProps: {},
  wearerProps: {},
});
```
