AI Sentiment Analysis API avatar
AI Sentiment Analysis API

Pricing

from $0.01 / 1,000 results

Go to Apify Store
AI Sentiment Analysis API

AI Sentiment Analysis API

Analyze text sentiment with AI. Emotion detection, key phrase extraction. Supports OpenAI GPT-4, Claude. Webhook Integration for Zapier, Make, n8n, or custom webhook.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

John Rippy

John Rippy

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Sentiment Analysis API

Analyze text sentiment using AI or rule-based analysis. Detect positive, negative, neutral, and mixed sentiments with emotion detection, confidence scores, and key phrase extraction.

Features

  • Multi-Model Support: Use OpenAI GPT-4o, Claude 3, or built-in rule-based analysis
  • Emotion Detection: Identify joy, anger, sadness, fear, surprise, and disgust
  • Key Phrase Extraction: Find phrases that influenced the sentiment
  • Topic Detection: Automatically detect subjects mentioned in the text
  • Batch Processing: Analyze multiple texts in a single run
  • Multi-Language: Support for English, Spanish, French, German, and more
  • Webhook Integration: Get notified when analysis completes

Use Cases

  • Review Analysis: Analyze customer reviews to understand sentiment trends
  • Social Media Monitoring: Track sentiment of brand mentions
  • Customer Feedback: Categorize support tickets by sentiment
  • Content Moderation: Flag negative or toxic content
  • Market Research: Analyze survey responses and feedback
  • Brand Health: Monitor overall sentiment over time

Input Parameters

ParameterTypeDescription
textsarrayArray of texts to analyze (max 100 per run)
textstringSingle text to analyze (use this OR texts array)
includeEmotionsbooleanDetect specific emotions (default: true)
includeKeyPhrasesbooleanExtract key phrases (default: true)
includeTopicsbooleanDetect topics/subjects (default: false)
languagestringLanguage code or "auto" (default: auto)
openaiApiKeystringYour OpenAI API key for GPT-4 analysis
anthropicApiKeystringYour Anthropic API key for Claude analysis
modelstringModel to use: auto, gpt-4o-mini, gpt-4o, claude-3-haiku, claude-3-sonnet, rule-based
webhookUrlstringURL to receive completion notification
demoModebooleanReturn sample data for testing

Output

The actor outputs a comprehensive analysis object:

{
"totalTexts": 3,
"overallSentiment": "mixed",
"averageScore": 0.07,
"results": [
{
"text": "I love this product! It's amazing.",
"sentiment": "positive",
"score": 0.92,
"confidence": 0.95,
"magnitude": 0.88,
"emotions": [
{ "name": "joy", "score": 0.85 },
{ "name": "surprise", "score": 0.15 }
],
"keyPhrases": ["love this product", "amazing"],
"topics": ["product", "quality"],
"language": "en",
"model": "gpt-4o-mini",
"processingTime": 245
}
],
"summary": {
"positive": 1,
"negative": 1,
"neutral": 1,
"mixed": 0
}
}

Sentiment Scores

  • score: -1 (most negative) to 1 (most positive)
  • confidence: 0 to 1, how confident the model is
  • magnitude: 0 to 1, strength of the sentiment

Sentiment Categories

  • positive: Score > 0.2
  • negative: Score < -0.2
  • neutral: Score between -0.2 and 0.2 with no mixed signals
  • mixed: Contains both positive and negative elements

Example Usage

Basic Sentiment Analysis

{
"texts": [
"I love this product! It's amazing.",
"Terrible customer service, never again.",
"The package arrived on time."
]
}

AI-Powered Analysis

{
"texts": ["Your product transformed my business! Thank you!"],
"openaiApiKey": "sk-...",
"model": "gpt-4o-mini",
"includeEmotions": true,
"includeKeyPhrases": true
}

Review Batch Analysis

{
"texts": [
"5 stars! Best purchase ever.",
"Product broke after 2 days.",
"Good value for money.",
"Shipping was slow but item was fine."
],
"anthropicApiKey": "sk-ant-...",
"model": "claude-3-haiku",
"includeTopics": true
}

With Webhook Notification

{
"texts": ["Great experience overall!"],
"webhookUrl": "https://hooks.zapier.com/your-webhook-id"
}

Models Comparison

ModelSpeedAccuracyCostAPI Key Required
rule-basedFastestGoodFreeNo
gpt-4o-miniFastExcellentLowYes (OpenAI)
gpt-4oMediumBestMediumYes (OpenAI)
claude-3-haikuFastExcellentLowYes (Anthropic)
claude-3-sonnetMediumBestMediumYes (Anthropic)

Pricing

This actor uses the pay-per-event pricing model:

  • Base cost: $0.05 per run
  • Per text: $0.002 per text analyzed (rule-based)
  • AI models: Additional cost based on API token usage

Example: Analyzing 100 reviews with rule-based = ~$0.25

Integration

Zapier/Make/n8n

Use the webhook URL to trigger automations when analysis completes. The webhook payload includes:

  • Total texts analyzed
  • Overall sentiment
  • Average score
  • Summary counts

Supabase/Database

Store results in your database for trend analysis and reporting.

Limitations

  • Maximum 100 texts per run
  • Text length limited to 2000 characters for AI models
  • Rule-based analysis works best with English text
  • AI models require valid API keys with sufficient credits

Support

For issues or feature requests, contact support.


Keywords

sentiment api, sentiment analysis, review sentiment, ai sentiment, text analysis, opinion mining, openai integration, claude integration