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

# SNS API

**Mainnet:** [**https://api.ordinalsbot.com/sns**](https://api.ordinalsbot.com/sns)

**Testnet:** [**https://testnet-api.ordinalsbot.com/sns**](https://testnet-api.ordinalsbot.com/sns)

You can refer to official OPI documentation for all available endpoints.

{% embed url="<https://github.com/bestinslot-xyz/OPI/blob/main/modules/sns_api/api.js>" %}

## Get SNS Info

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/sns/v1/sns/get_info_of_sns`

#### Query Parameters

| Name                                   | Type   | Description                             |
| -------------------------------------- | ------ | --------------------------------------- |
| name<mark style="color:red;">\*</mark> | String | SNS to get info for (e.g. satoshi.sats) |

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

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

```json
{
    "error": null,
    "result": {
        "inscription_id": "26d5ad9f79aeb7f787e040e40f193e0d4f4e4bbf12fb5f7977bade6cb910ab5di0",
        "inscription_number": 207,
        "domain": "sats",
        "sns_name": "satoshi.sats"
    }
}
```

{% endtab %}
{% endtabs %}

## Get SNS Owned by Address

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/sns/v1/sns/get_sns_of_address`

#### Query Parameters

| Name                                      | Type   | Description                      |
| ----------------------------------------- | ------ | -------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Bitcoin address to check balance |

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

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

```json
{
    "error": null,
    "result": [
        {
            "inscription_id": "26d5ad9f79aeb7f787e040e40f193e0d4f4e4bbf12fb5f7977bade6cb910ab5di0",
            "inscription_number": 207,
            "sns_name": "satoshi.sats"
        },
         ...
        {
            "inscription_id": "d2e34bd00eb1bf7d0f88acfccc31e8ca68a45097279ad07eafd06910bd1fa8a6i0",
            "inscription_number": 391,
            "sns_name": "d.sats"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get SNS Count of Address

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/sns/v1/sns/get_sns_count_of_address`

#### Query Parameters

| Name                                      | Type   | Description                      |
| ----------------------------------------- | ------ | -------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Bitcoin address to check balance |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

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

```json
{
    "error": null,
    "result": [
        {
            "count": "16"
        }
    ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}
