POST
/
generate
/
sentiments
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"text": "These shoes aren't the best. The color has faded and they are uncomfortable to walk in."}' \
-X POST https://api.ayrshare.com/api/generate/sentiment
{
    "status": "success",
    "text": "These shoes aren't the best. The color has faded and they are uncomfortable to walk in.",
    "sentimentAnalysis": {
        "sentiment": "negative", // positive, negative, or neutral
        "opportunities": [
            "Improve color durability",
            "Enhance comfort level"
        ],
        "recommendations": [
            {
                "opportunity": "Improve color durability",
                "recommendation": "Investigate and use higher-quality dyes or materials to prevent fading over time."
            },
            {
                "opportunity": "Enhance comfort level",
                "recommendation": "Review and possibly redesign the shoe's insole and cushioning to provide better support and comfort for walking."
            }
        ]
    }
}
Available on Premium, Business, Enterprise plans.Max Pack required

Generate a sentiment analysis on a social media post or comment to understand if the text is positive, negative, or neutral and recommendations on improving the text for a more positive reaction.

Header Parameters

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY

Body Parameters

text
string
required

The string of text to generate the sentiment analysis on.

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"text": "These shoes aren't the best. The color has faded and they are uncomfortable to walk in."}' \
-X POST https://api.ayrshare.com/api/generate/sentiment
{
    "status": "success",
    "text": "These shoes aren't the best. The color has faded and they are uncomfortable to walk in.",
    "sentimentAnalysis": {
        "sentiment": "negative", // positive, negative, or neutral
        "opportunities": [
            "Improve color durability",
            "Enhance comfort level"
        ],
        "recommendations": [
            {
                "opportunity": "Improve color durability",
                "recommendation": "Investigate and use higher-quality dyes or materials to prevent fading over time."
            },
            {
                "opportunity": "Enhance comfort level",
                "recommendation": "Review and possibly redesign the shoe's insole and cushioning to provide better support and comfort for walking."
            }
        ]
    }
}