# Lookup

The lookup endpoint retrieves the balance associated with a single private key string. It will display the balance for both BSV and/or STAS tokens that are housed in the corresponding address. Users can customize responses using additional header parameters, such as currency type, pagination, protocol type (including variations of BSV and/or STAS), and compact mode.<br>

Body Params

```javascript
{
 privateKey : "string"
}
```

<mark style="color:green;">`POST`</mark> `https://api.relysia.com/v1/lookup`

Returns Balance of all assets of Private Key

#### Headers

| Name          | Type    | Description                                                                                                                                                                                             |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type          | String  | Type refers to the protocol returned such as BSV, STAS-20, STAS-789. Default ALL will be used and return all.                                                                                           |
| currency      | String  | Currency type such as USD, CAD, AUD, or any other supported currency type. Default set to USD.                                                                                                          |
| nextPageToken | Number  | Will provide the next page of balance determine by starting point number provided. By default, will start at 0.                                                                                         |
| compact       | Boolean | Compact will be set default to true. This refers to STAS tokens specifically will return total balances of each token Id. Compact false will return each UTXO that comprises of all the total balances. |
| maxResults    | Number  | Number of result in the array provided. Default set to 19, where the BSV balance make the total of 20 returned.                                                                                         |

#### Request Body

| Name                                         | Type   | Description              |
| -------------------------------------------- | ------ | ------------------------ |
| privateKey<mark style="color:red;">\*</mark> | String | Private key string value |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "operation completed successfully",
    "totalBalance": {
      "currency": "USD",
      "balance": 0.0000030209549035757473
    },
    "coins": [
      {
        "protocol": "BSV",
        "balance": 1e-7
      },
      {
        "protocol": "STAS",
        "tokenId": "8b07511349a2d715abc1777777b4c078241a62e5-TESTTOKEN444",
        "splittable": true,
        "name": "Store Bonus Points",
        "address": "1JpvnEDrLR1rXZrUZNkhWSJd3x9D9ib16i",
        "satsPerToken": 1,
        "symbol": "TESTTOKEN444",
        "redeemAddr": "8b07511349a2d715abc1777777b4c078241a62e5",
        "image": "https://upload.wikimedia.org/wikipedia/en/9/95/Test_image.jpg",
        "amount": 3,
        "supply": 3,
        "decimals": 0,
        "sn": [
          0
        ]
      },
      {
        "protocol": "STAS",
        "tokenId": "8b07511349a2d715abc1777777b4c078241a62e5-TESTNFT444",
        "splittable": true,
        "name": "Store Bonus Points",
        "address": "1JpvnEDrLR1rXZrUZNkhWSJd3x9D9ib16i",
        "satsPerToken": 1,
        "symbol": "TESTNFT444",
        "redeemAddr": "8b07511349a2d715abc1777777b4c078241a62e5",
        "image": "https://upload.wikimedia.org/wikipedia/en/9/95/Test_image.jpg",
        "amount": 3,
        "supply": 3,
        "decimals": 0,
        "sn": [
          0
        ]
      }
    ],
    "meta": {
      "nextPageToken": null
    }
  }
```

{% endtab %}
{% endtabs %}


---

# 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.relysia.com/payments/lookup.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.
