APITube Help Center

How Does Sentiment Analysis Work?

Read positive, negative, and neutral tone in article responses

Tasha Tatum

Written by Tasha Tatum

July 2, 2026

Updated October 16, 2026

Open this example in the API Playground ↗

How does sentiment analysis work?

Sentiment describes the tone of an article. APITube returns a score from -1 to 1 and a polarity label: positive, negative, or neutral. You can read these values in the response, filter by them, or use them to sort results.

Separate values describe the whole article, headline, body, key sentences, and named subjects such as companies or people.

What is sentiment in the APITube News API?

Each sentiment result has two parts:

  • Polarity: a label for positive, negative, or neutral tone.
  • Score: a number from -1 for strongly negative to 1 for strongly positive tone. Values near zero indicate little emotional tone.

Use the label to group articles, or the score to set a range or sort order.

What do the sentiment score and polarity mean?

The score indicates how positive or negative the tone is. The label summarizes that reading. Here is an example:

{
    "sentiment": {
        "overall": { "score": -0.01, "polarity": "neutral" },
        "title": { "score": -0.09, "polarity": "negative" },
        "body": { "score": 0.07, "polarity": "positive" }
    }
}

The overall, headline, and body values can differ. A negative headline can appear above a mildly positive article body.

Which parts of an article get their own sentiment?

You can read score and polarity for:

  • Overall article: sentiment.overall.
  • Headline: sentiment.title.
  • Body: sentiment.body.
  • Key sentences: the sentiment field on each sentence in summary.
  • Entities: the sentiment field on each named subject in entities. Its mentions counts positive, neutral, and negative references.

For example:

{
    "entities": [
        {
            "name": "Tesla",
            "type": "organization",
            "sentiment": {
                "score": -0.62,
                "polarity": "negative",
                "mentions": { "positive": 1, "neutral": 2, "negative": 5 }
            }
        }
    ]
}

An article can be positive overall and negative about a company it mentions. See how to get sentiment toward a company or person.

Why can the headline and the body have different sentiment?

They describe different text. Use these filters to find agreement or differences:

  • sentiment.mixed=1: headline and body labels differ. sentiment.consistent=1: they match.
  • sentiment_gap.min and sentiment_gap.max: the difference between their scores, on a 0–2 scale.
  • is_clickbait=1: the headline and body labels differ, and the headline has a strongly positive or negative score.

This request finds articles with a larger headline-to-body score difference:

curl "https://api.apitube.io/v1/news/everything?sentiment_gap.min=0.5&api_key=YOUR_API_KEY"

How do I use sentiment in a request?

Use sentiment.overall.polarity to choose a tone, or sentiment.overall.score.min and .max for a score range. Sort with sort.by=sentiment.overall.score.

This example puts the most positive coverage of a company first:

curl "https://api.apitube.io/v1/news/everything?organization.name=Netflix&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"

Send the key in api_key or the X-API-Key header. See how to filter news by sentiment and the official response structure reference.

Common Questions

Does every article have a sentiment score?

The sentiment object includes overall, title, and body. An unavailable reading has score: 0 and an empty polarity. Treat an empty label as not scored, rather than neutral.

Can I sort articles by how positive or negative they are?

Yes. Use sort.by=sentiment.overall.score, sentiment.title.score, or sentiment.body.score. Set sort.order=desc for most positive first, or asc for most negative first. Other filters can be used in the same request.

Is sentiment the same as the entity sentiment?

Overall sentiment describes the article’s tone. Entity sentiment describes the tone toward one named subject. They can differ, so choose the field that fits your question.


Related Articles