Skip to content

Sentiment Query Examples

Getting news with positive sentiment

This query retrieves news articles with positive sentiment.

python
params = {
    "sentiment.overall.polarity": "positive",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"

News with positive sentiment from a specific country

This query retrieves news articles with positive sentiment from Japan.

python
params = {
    "sentiment.overall.polarity": "positive",
    "source.country.code": "jp",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&source.country.code=jp&api_key=YOUR_API_KEY"

Positive news from the last 24 hours

This query retrieves news articles with positive sentiment published in the last 24 hours.

python
params = {
    "sentiment.overall.polarity": "positive",
    "published_at.start": "2024-12-02",
    "published_at.end": "2024-12-03",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&published_at.start=2024-12-02&published_at.end=2024-12-03&api_key=YOUR_API_KEY"

Articles with positive sentiment and a specific topic

This query retrieves articles with positive sentiment containing "technology" in the title.

python
params = {
    "sentiment.overall.polarity": "positive",
    "title": "technology",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&title=technology&api_key=YOUR_API_KEY"

Multidimensional sentiment analysis

This query analyzes articles with high positive sentiment about specific organizations and categories.

python
params = {
    "sentiment.overall.score.min": "0.7",
    "category.id": "2,4",
    "organization.name": "Tesla,SpaceX",
    "published_at.start": "2023-01-01",
    "sort.by": "sentiment.overall.score",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=2,4&organization.name=Tesla,SpaceX&published_at.start=2023-01-01&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"

Comparative sentiment analysis across markets

This query analyzes negative sentiment in economic news from different countries.

python
params = {
    "sentiment.overall.polarity": "negative",
    "source.country.code": "us,uk,de",
    "category.id": "6",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=negative&source.country.code=us,uk,de&category.id=6&published_at.start=2023-01-01&published_at.end=2023-12-31&api_key=YOUR_API_KEY"

Analysis of sentiment divergence by source types

This query analyzes differences in sentiment between scientific and news sources.

python
params = {
    "topic.id": "climate_change",
    "sentiment.overall.score.min": "0.6",
    "source.domain": "scientific.journals,mainstream.news",
    "published_at.start": "2023-01-01",
    "sort.by": "source.domain",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?topic.id=climate_change&sentiment.overall.score.min=0.6&source.domain=scientific.journals,mainstream.news&published_at.start=2023-01-01&sort.by=source.domain&api_key=YOUR_API_KEY"

Sentiment analysis in product reviews

This query analyzes the emotional tone in Samsung Galaxy S23 reviews.

python
params = {
    "title": "review",
    "brand.name": "Samsung Galaxy S23",
    "sentiment.overall.score.min": "-1.0",
    "sentiment.overall.score.max": "1.0",
    "published_at.start": "2023-01-01",
    "sort.by": "sentiment.overall.score",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?title=review&brand.name=Samsung%20Galaxy%20S23&sentiment.overall.score.min=-1.0&sentiment.overall.score.max=1.0&published_at.start=2023-01-01&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"

Sentiment timeline analysis for market events

This query tracks sentiment evolution before and after major financial market events, with precisely defined sentiment thresholds and source credibility requirements.

python
params = {
    "category.id": "2",
    "title": "market crash,recession,bear market,financial crisis",
    "sentiment.overall.score.min": "-1.0",
    "sentiment.overall.score.max": "1.0",
    "source.rank.opr.min": "0.8",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "sort.by": "published_at,sentiment.overall.score",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=2&title=market%20crash,recession,bear%20market,financial%20crisis&sentiment.overall.score.min=-1.0&sentiment.overall.score.max=1.0&source.rank.opr.min=0.8&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=published_at,sentiment.overall.score&api_key=YOUR_API_KEY"