> For the complete documentation index, see [llms.txt](https://docs.xpay.stream/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xpay.stream/wallets/search-wallets.md).

# Search Wallets

{% hint style="info" %}
**API Endpoint**

**POST** [**/client/wallets/find**](https://xpay.stream/client/wallets/find)
{% endhint %}

***

{% hint style="info" %}
**Request Headers:**

Authorization: Bearer [\<access\_token>](/authentication-api.md)

Content-Type: application/json<br>

**Request Body**

* **List All** finds all your wallets

```json
{

    "page": 1,        // optional - if not present, default 1
    "pageSize": 20,    // optional - if not present, default 10

    // sorting is optional
    // when not set wallets are sorted by Creation Date Descending
    
    "sort" : { // sort by date, USDT Balance, Tron Balance
        "createdAt": 1     // ascending 1, descending -1, default -1
        "tokenBalance": 1, // ascending 1, descending -1, default -1
        "tokenBalance": 1, // ascending 1, descending -1, default -1        
     }
}
```

* **Search by wallet UUID:** *(previous paging and sorting applies)*

{% code lineNumbers="true" %}

```json
{
    "wallet": "uuid" // wildcard uuid search
}
```

{% endcode %}

* **Search By Wallet Tag:** *(previous paging and sorting applies)*

{% code lineNumbers="true" %}

```json
{
    "tag": "tag" // wildcard tag search
}
```

{% endcode %}

* **Search By Wallet Tron Address :** *(previous paging and sorting applies)*

{% code lineNumbers="true" %}

```json
{
    "address": "tag" // wildcard tron address search
}
```

{% endcode %}
{% endhint %}

{% hint style="success" %}
**Success Response**\
By default all search results are paged, with 10 items per page.

You can specify in your request the page number and number of items per page. Find in response, which page you are, if more pages are availabe (nextPage: true), total count for all items without paging and the total found for items count in this page.

**`Example Below:`**

{% code lineNumbers="true" fullWidth="true" %}

```json
{
	"success": {
		"message": "Done",
		"data": [
			{
				"uuid": "dd249743-22a3-42fb-8d86-3e27287272e2",
				"address": {
					"base58": "TYViWxHG5wgnnmCMfVfwTvp3KGkRt4qk7V",
					"hex": "41F717E263E541FDB3C69F7F5062D0573EFF8A9760"
				},
				"balances": {
					"tokenBalanceRaw": 0,
					"tokenBalance": 0,
					"tronBalanceSun": 0,
					"tronBalance": 0
				},
				"createdAt": 1697182976392,
				"tag": "master-wallet",
				"username": "<email>"
			},
			{
				"uuid": "2909524c-843f-49e2-8095-003c031b289d",
				"address": {
					"base58": "TUh4w1dUQjKdGrJhEU4MPhWYWxHFHsv7G1",
					"hex": "41CD5CFF89499AD52F3567C22B2435565EF65BCB9B"
				},
				"balances": {
					"tokenBalanceRaw": 0,
					"tokenBalance": 0,
					"tronBalanceSun": 0,
					"tronBalance": 0
				},
				"createdAt": 1696856906560,
				"tag": "secondary",
				"username": "<email>"
			}
		]
	},
	"page": 1,
	"pageSize": 10,
	"foundCount": 4,
	"totalCount": 4,
	"nextPage": false,
	"uuid": "ab6b9cc6-76ad-4f14-8ec3-c88a9f3397ee"
}
```

{% endcode %}
{% endhint %}

***

{% tabs %}
{% tab title="CURL Example" %}
{% code lineNumbers="true" fullWidth="true" %}

```bash
curl 'https://apis.xpay.stream/client/wallets/find' \
  -H 'Authorization: Bearer <access_token>'         \
  -H 'Content-Type: application/json'               \
  --data-raw '{}'             
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS Example" %}
{% code lineNumbers="true" %}

```javascript
// npm i cross-fetch
const fetch = require("cross-fetch");

const API_URL = "https://apis.xpay.stream/client/wallets/find";

const method = "POST";

const headers = { 
    "Content-Type": "application/json",
    "Authorization": "Bearer <access_token>"
};

const body = JSON.stringify({
    page: 1,
    pageSize: 20 
});

fetch(API_URL, { headers, body, method })
.then(async res =>  await res.json())
.then(result => {
    if(result.error)
        console.log("Wallets Search Error", result);
    if(result.success)
        console.log("Wallet Searched", result);
})
.catch((err) => {
    console.error("Wallet Search API Exception", err);
});
```

{% endcode %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.xpay.stream/wallets/search-wallets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
