Breaking news with engagement sorting and media
Get breaking news sorted by engagement potential with media requirements and source quality
输入参数
| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| is_breaking | Filter breaking news articles. | integer | 1 | Yes |
| media.images.count.min | Minimum number of images. | integer | Yes | |
| sort.by | Sort by engagement score. | string | Yes | |
| sort.order | Descending order. | string | Yes | |
| source.rank.opr.min | Minimum source quality. | string | Yes | |
| is_duplicate | Exclude duplicates. | integer | 0 | Yes |
| api_key | Your API key. | string | Yes | |
| per_page | Maximum number of articles to retrieve. | integer | 30 | No |
Workflow examples
Request for engaging breaking news with media:
curl -X GET "https://api.apitube.io/v1/news/everything?is_breaking=1&media.images.count.min=2&sort.by=engagement&sort.order=desc&api_key=YOUR_API_KEY"
Request for only breaking news monitoring:
curl -X GET "https://api.apitube.io/v1/news/everything?is_breaking=1&api_key=YOUR_API_KEY"
Request for breaking news distribution by hour:
curl -X GET "https://api.apitube.io/v1/news/everything?is_important=1&facet=true&facet.field=published.hour,category.id&api_key=YOUR_API_KEY"
食谱 cURL
curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?is_breaking=1&media.images.count.min=2&sort.by=engagement&sort.order=desc&source.rank.opr.min=0.6&is_duplicate=0&api_key=YOUR_API_KEY&per_page=30' \
--header 'Content-Type: application/json'
食谱 Python
import requests
url = "https://api.apitube.io/v1/news/everything"
querystring = {
"is_breaking": 1,
"media.images.count.min": 2,
"sort.by": "engagement",
"sort.order": "desc",
"source.rank.opr.min": 0.6,
"is_duplicate": 0,
"api_key": "YOUR_API_KEY",
"per_page": 30
}
response = requests.request("GET", url, params=querystring)
print(response.text)
食谱 Javascript
import axios from "axios"
const options = {
method: 'GET',
url: 'https://api.apitube.io/v1/news/everything',
params: {
"is_breaking": 1,
"media.images.count.min": 2,
"sort.by": "engagement",
"sort.order": "desc",
"source.rank.opr.min": 0.6,
"is_duplicate": 0,
"api_key": "YOUR_API_KEY",
"per_page": 30
}};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
食谱 PHP
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.apitube.io/v1/news/everything', [
'query' => [
'is_breaking' => 1,
'media.images.count.min' => 2,
'sort.by' => 'engagement',
'sort.order' => 'desc',
'source.rank.opr.min' => 0.6,
'is_duplicate' => 0,
'api_key' => 'YOUR_API_KEY',
'per_page' => 30,
],
]);
echo $response->getBody();
食谱 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?is_breaking=1&media.images.count.min=2&sort.by=engagement&sort.order=desc&source.rank.opr.min=0.6&is_duplicate=0&api_key=YOUR_API_KEY&per_page=30")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();