Detect Sentiment

Detect the sentiment (positive or negative) of a given text. The entire document is scored and also each individual sentence.

GET
https://api.apileague.com/detect-sentiment
Example Request and Response
GET
https://api.apileague.com/{{ examples.getDetectSentiment }}
{
    "document": {
        "sentiment": "positive",
        "confidence": 1,
        "average_confidence": 1
    },
    "sentences": [
        {
            "sentiment": "positive",
            "offset": 0,
            "confidence": 1,
            "length": 34
        }
    ]
}
cURL
Java
Javascript
Python
Go
C#
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}