Multi-dimensional sentiment analysis with source filtering
Analyze sentiment across multiple organizations with high-quality sources and time range filtering
Input parameters
| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| sentiment.overall.score.min | Minimum sentiment score (0.7 = strong positive). | float | Yes | |
| category.id | Category filter. | string | Yes | |
| organization.name | Multiple organizations (comma-separated). | string | Yes | |
| published_at.start | Start date for time range. | string | Yes | |
| source.rank.opr.min | Minimum source quality rank. | string | Yes | |
| sort.by | Sort by sentiment score. | string | Yes | |
| sort.order | Descending order. | string | Yes | |
| api_key | Your API key. | string | Yes | |
| per_page | Maximum number of articles to retrieve. | integer | 20 | No |
Workflow examples
Request for multi-dimensional sentiment analysis:
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=medtop:04000000&organization.name=Tesla,SpaceX&published_at.start=2023-01-01&source.rank.opr.min=0.7&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"
Request for comparative sentiment analysis across markets:
curl -X GET "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=negative&source.country.code=us,uk,de&category.id=medtop:07000000&published_at.start=2023-01-01&published_at.end=2023-12-31&api_key=YOUR_API_KEY"
Request for sentiment divergence analysis by source type:
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&api_key=YOUR_API_KEY"
Recipe for cURL
curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=medtop%3A04000000&organization.name=Tesla%2CSpaceX&published_at.start=2023-01-01&source.rank.opr.min=0.7&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY&per_page=20' \
--header 'Content-Type: application/json'
Recipe for Python
import requests
url = "https://api.apitube.io/v1/news/everything"
querystring = {
"sentiment.overall.score.min": 0.7,
"category.id": "medtop:04000000",
"organization.name": "Tesla,SpaceX",
"published_at.start": "2023-01-01",
"source.rank.opr.min": 0.7,
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
"per_page": 20
}
response = requests.request("GET", url, params=querystring)
print(response.text)
Recipe for Javascript
import axios from "axios"
const options = {
method: 'GET',
url: 'https://api.apitube.io/v1/news/everything',
params: {
"sentiment.overall.score.min": 0.7,
"category.id": "medtop:04000000",
"organization.name": "Tesla,SpaceX",
"published_at.start": "2023-01-01",
"source.rank.opr.min": 0.7,
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
"per_page": 20
}};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Recipe for PHP
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.apitube.io/v1/news/everything', [
'query' => [
'sentiment.overall.score.min' => 0.7,
'category.id' => 'medtop:04000000',
'organization.name' => 'Tesla,SpaceX',
'published_at.start' => '2023-01-01',
'source.rank.opr.min' => 0.7,
'sort.by' => 'sentiment.overall.score',
'sort.order' => 'desc',
'api_key' => 'YOUR_API_KEY',
'per_page' => 20,
],
]);
echo $response->getBody();
Recipe for Java
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=medtop%3A04000000&organization.name=Tesla%2CSpaceX&published_at.start=2023-01-01&source.rank.opr.min=0.7&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY&per_page=20")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();