Sentiment Analysis API

Sentiment Analysis API

Perform sentiment analysis on a sentence, paragraph or a single word

Overview

The Sentiment Analysis API is a powerful tool for conducting comprehensive sentiment analysis on textual data. Designed to meet the needs of developers, businesses, and researchers, this API leverages state-of-the-art natural language processing techniques to provide accurate and nuanced insights into the sentiment expressed within text.

Features

Example

The Sentiment Analysis API only supports one GET endpoint. Send the following request to validate an email:

curl -X 'GET' 'https://anyapi.io/api/v1/sentiment?input=I%27m%20feeling%20great%20today&apiKey=<YOUR_API_KEY>'

which returns this payload:

{
  "sentiment": "positive",
  "score": 0.8,
  "language": "English",
  "tokens": [
    "I",
    "m",
    "feeling",
    "great",
    "today"
  ]
}

Note: the field score in the response is a decimal number between 1 and 0.

Another example to run sentiment analysis on a Portuguese input where the language is detected automatically:

curl -X 'GET' 'https://anyapi.io/api/v1/sentiment?input=O%20sol%20brilha%20intensamente%20no%20céu%20azul&apiKey=<YOUR_API_KEY>'
{
  "sentiment": "positive",
  "score": 0.25,
  "language": "Portuguese",
  "tokens": [
    "O",
    "sol",
    "brilha",
    "intensamente",
    "no",
    "c",
    "u",
    "azul"
  ]
}

Or pass in the language explicitly to run the classifier:

curl -X 'GET' 'https://anyapi.io/api/v1/sentiment?input=El%20sol%20brilla%20intensamente%20en%20el%20cielo%20azul&language=Spanish&apiKey=<YOUR_API_KEY>'
{
  "sentiment": "positive",
  "score": 0.5,
  "language": "Spanish",
  "tokens": [
    "El",
    "sol",
    "brilla",
    "intensamente",
    "en",
    "el",
    "cielo",
    "azul"
  ]
}

Endpoints

This API provides the following endpoints:

Check out the Sentiment Analysis API Docs for more details.