Text Sentiment Analyzer

FREEMIUM
Health Check

N/A

README

Creating documentation for your RESTful POST API that analyzes the sentiment of a text input is crucial for developers to understand how to use your API effectively. Below is a sample documentation outline for your API, including an overview, endpoint information, request and response examples, and additional notes for clarity and best practices.


Sentiment Analysis API Documentation

API Endpoint

POST /get-sentiment-analysis

This endpoint accepts a JSON payload with the text to be analyzed and returns the sentiment analysis result.

Request Parameters

  • text (required): The text string you want to analyze. It can be a sentence, a paragraph, or just a few words.

Request Example

To analyze the sentiment of a text, you need to send a JSON payload in the body of the request with the text parameter.

POST /api/sentiment/analyze HTTP/1.1
Host: yourapi.com
Content-Type: application/json
X-RapidAPI-Key: '36d91600a6msh2661a0538a3d030p1dd9dfjsn7e5e980351f2',
X-RapidAPI-Host: text-sentiment-analyzer1.p.rapidapi.com

{
  "text": "I love this car but I'm not sure about the price. I'm gonna go home to think about it."
}

Response

The API response will include a status code and, if successful, a JSON object containing the sentiment analysis result.

Success Response

  • Code: 200 OK
  • Content:
{
  "sentiment": "Neutral"
}

Error Responses

  • Code: 400 Bad Request
    • Content: {"error": "Invalid request. Please provide the text for analysis."}
  • Code: 401 Unauthorized
    • Content: {"error": "Unauthorized. Please provide a valid API key."}
  • Code: 500 Internal Server Error
    • Content: {"error": "An unexpected error occurred. Please try again later."}
Followers: 0
API Creator:
Rapid account: Christian Coello
Christian Coello
christiancoello2389
Log In to Rate API
Rating: 5 - Votes: 1