# Sentiment API Endpoint

## Get Sentiment of Message by Transaction ID.

## Get the Sentiment of a Derupt Message

<mark style="color:blue;">`GET`</mark> `https://sentiment.derupt.io/sentiment?txid={txid}&who={principal}`

Returns Sentiment of Derupt message, referenced by its Stacks Transaction `txid`

#### Path Parameters

| Name                                   | Type   | Description                                   |
| -------------------------------------- | ------ | --------------------------------------------- |
| txid<mark style="color:red;">\*</mark> | string | Stacks Transaction `txid` of message          |
| who<mark style="color:red;">\*</mark>  | string | Derupt Authenticated User `principal` address |

{% tabs %}
{% tab title="200 Returns Sentiment" %}

```javascript
{
    "txid": "0xef066bc2c49526f400e6269e7b547700e0b2ecd8f859ae3715623baa71f2f151",
    "likes": 1,
    "dislikes": 1,
    "replies": 0,
    "who": "SP261NT1ZC1JFX0JGFGKZM8AC8Q703MK1SP0X3S0W",
    "liked": true,
    "disliked": true,
    "replied": false
}
```

{% endtab %}

{% tab title="400: Bad Request Error in Request" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Count Sums:** \
Likes and Dislikes are on chain, however the running sum total is calculated overtime off chain and served via APIs.&#x20;
{% endhint %}

{% hint style="warning" %}
**Count Validation Considerations:**&#x20;

* Verification of token transferred from Liker to Author is CryptoCash when Liking.
* Verification of token transferred from Liker to Author are different Addresses.
* Verification of token stacked from Disliker is CryptoCash when Disliking.&#x20;
* Verification of unique action per Message.(eg 1 Like & Dislike from 1 account address)
  {% endhint %}

{% hint style="info" %}
Want to learn how to setup your own Derupt Sentiment API Node? \
Check out the [**Sentiment API Setup Guide**](/latest/api/setup-guide.md)
{% endhint %}


---

# 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.derupt.io/latest/api/sentiment-endpoint.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.
