按参与度排序的突发新闻,包含图片和视频
按参与潜力对突发新闻进行排序。按媒体要求和来源质量进行筛选
输入参数
| 参数 | 描述 | 类型 | 默认 | 必需 |
|---|---|---|---|---|
| is_breaking | 过滤突发新闻文章。 | integer | 1 | 是 |
| media.images.count.min | 最小图片数。 | integer | 是 | |
| sort.by | 按参与度分数排序。 | string | 是 | |
| sort.order | 降序。 | string | 是 | |
| source.rank.opr.min | 最小来源质量。 | string | 是 | |
| is_duplicate | 排除重复项。 | integer | 0 | 是 |
| api_key | 您的 API 密钥 | string | 是 | |
| per_page | 要检索的最大文章数 | integer | 30 | 否 |
工作流程示例
包含媒体的引人入胜的突发新闻:
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"
仅限突发新闻监控:
curl -X GET "https://api.apitube.io/v1/news/everything?is_breaking=1&api_key=YOUR_API_KEY"
按小时发布的突发新闻分发请求:
curl -X GET "https://api.apitube.io/v1/news/everything?is_breaking=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();