# 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: {},
});
```


---

# 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.hatsprotocol.xyz/for-developers/v1-sdk/subgraph/misc.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.
