Geopolitical event analysis with location filtering
Analyze geopolitical events across multiple locations with category and time filtering
Invoerparameter
| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| location.name | Multiple locations (comma-separated). | string | Yes | |
| category.id | Category filter. | string | Yes | |
| published_at.start | Start date filter. | string | Yes | |
| sort.by | Sort by publication date. | string | Yes | |
| sort.order | Ascending order for timeline. | string | Yes | |
| source.rank.opr.min | Minimum source quality. | string | Yes | |
| api_key | Your API key. | string | Yes | |
| per_page | Maximum number of articles to retrieve. | integer | 40 | No |
Workflow examples
Request for geopolitical event analysis:
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=France,Italy&category.id=medtop:11000000&published_at.start=2022-02-01&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"
Request for natural disaster coverage analysis:
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=Florida,Louisiana&title=hurricane&published_at.start=2022-06-01&published_at.end=2022-11-30&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"
Request for tourism sentiment analysis by location:
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=Bali,Phuket,Maldives&sentiment.overall.polarity=positive&published_at.start=2023-01-01&sort.by=published_at&api_key=YOUR_API_KEY"
Request for regional language news comparison:
curl -X GET "https://api.apitube.io/v1/news/everything?language.code=ar,he&category.id=medtop:11000000&published_at.start=2023-01-01&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"
Recept voor cURL
curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?location.name=France%2CItaly&category.id=medtop%3A11000000&published_at.start=2022-02-01&sort.by=published_at&sort.order=asc&source.rank.opr.min=0.6&api_key=YOUR_API_KEY&per_page=40' \
--header 'Content-Type: application/json'
Recept voor Python
import requests
url = "https://api.apitube.io/v1/news/everything"
querystring = {
"location.name": "France,Italy",
"category.id": "medtop:11000000",
"published_at.start": "2022-02-01",
"sort.by": "published_at",
"sort.order": "asc",
"source.rank.opr.min": 0.6,
"api_key": "YOUR_API_KEY",
"per_page": 40
}
response = requests.request("GET", url, params=querystring)
print(response.text)
Recept voor Javascript
import axios from "axios"
const options = {
method: 'GET',
url: 'https://api.apitube.io/v1/news/everything',
params: {
"location.name": "France,Italy",
"category.id": "medtop:11000000",
"published_at.start": "2022-02-01",
"sort.by": "published_at",
"sort.order": "asc",
"source.rank.opr.min": 0.6,
"api_key": "YOUR_API_KEY",
"per_page": 40
}};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Recept voor PHP
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.apitube.io/v1/news/everything', [
'query' => [
'location.name' => 'France,Italy',
'category.id' => 'medtop:11000000',
'published_at.start' => '2022-02-01',
'sort.by' => 'published_at',
'sort.order' => 'asc',
'source.rank.opr.min' => 0.6,
'api_key' => 'YOUR_API_KEY',
'per_page' => 40,
],
]);
echo $response->getBody();
Recept voor 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?location.name=France%2CItaly&category.id=medtop%3A11000000&published_at.start=2022-02-01&sort.by=published_at&sort.order=asc&source.rank.opr.min=0.6&api_key=YOUR_API_KEY&per_page=40")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();