完整的新闻监控解决方案
通过过滤、排序、按字段的文章计数、搜索高亮显示和导出功能监控新闻
输入参数
| 参数 | 描述 | 类型 | 默认 | 必需 |
|---|---|---|---|---|
| organization.name | 多个组织(逗号分隔)。 | string | 是 | |
| title | 关键字(逗号分隔)。 | string | 是 | |
| category.id | 类别过滤器。 | string | 是 | |
| sentiment.overall.polarity | 按情绪过滤。 | string | 是 | |
| published_at.start | 开始日期过滤器。 | string | 是 | |
| source.rank.opr.min | 最小来源质量。 | string | 是 | |
| is_duplicate | 排除重复项。 | integer | 0 | 是 |
| has_image | 需要图片。 | integer | 1 | 是 |
| sort.by | 按质量分数排序。 | string | 是 | |
| sort.order | 降序。 | string | 是 | |
| facet | 按字段计数文章。 | boolean | true | 是 |
| facet.field | 用于分组统计文章数量的字段。 | string | 是 | |
| hl | 启用高亮显示。 | boolean | true | 是 |
| hl.fl | 要突出显示的字段。 | string | 是 | |
| per_page | 要检索的最大文章数 | integer | 50 | 是 |
| api_key | 您的 API 密钥 | string | 是 |
工作流程示例
完整的新闻监控解决方案:
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Apple,Google,Microsoft&title=innovation,technology&category.id=medtop:04000000&sentiment.overall.polarity=positive&published_at.start=2024-01-01&published_at.end=2024-01-31&source.rank.opr.min=5&is_duplicate=0&has_image=1&sort.by=quality&sort.order=desc&facet=true&facet.field=source.id,language.id&hl=true&hl.fl=title,description&per_page=50&api_key=YOUR_API_KEY"
导出到 Excel:
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Apple,Google,Microsoft&published_at.start=2024-01-01&export=xlsx&api_key=YOUR_API_KEY" -o monitoring_report.xlsx
相关示例
食谱 cURL
curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?organization.name=Apple%2CGoogle%2CMicrosoft&title=innovation%2Ctechnology&category.id=medtop%3A04000000&sentiment.overall.polarity=positive&published_at.start=2024-01-01&source.rank.opr.min=5&is_duplicate=0&has_image=1&sort.by=quality&sort.order=desc&facet=1&facet.field=source.id%2Clanguage.id&hl=1&hl.fl=title%2Cdescription&per_page=50&api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json'
食谱 Python
import requests
url = "https://api.apitube.io/v1/news/everything"
querystring = {
"organization.name": "Apple,Google,Microsoft",
"title": "innovation,technology",
"category.id": "medtop:04000000",
"sentiment.overall.polarity": "positive",
"published_at.start": "2024-01-01",
"source.rank.opr.min": 5,
"is_duplicate": 0,
"has_image": 1,
"sort.by": "quality",
"sort.order": "desc",
"facet": true,
"facet.field": "source.id,language.id",
"hl": true,
"hl.fl": "title,description",
"per_page": 50,
"api_key": "YOUR_API_KEY"
}
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: {
"organization.name": "Apple,Google,Microsoft",
"title": "innovation,technology",
"category.id": "medtop:04000000",
"sentiment.overall.polarity": "positive",
"published_at.start": "2024-01-01",
"source.rank.opr.min": 5,
"is_duplicate": 0,
"has_image": 1,
"sort.by": "quality",
"sort.order": "desc",
"facet": true,
"facet.field": "source.id,language.id",
"hl": true,
"hl.fl": "title,description",
"per_page": 50,
"api_key": "YOUR_API_KEY"
}};
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' => [
'organization.name' => 'Apple,Google,Microsoft',
'title' => 'innovation,technology',
'category.id' => 'medtop:04000000',
'sentiment.overall.polarity' => 'positive',
'published_at.start' => '2024-01-01',
'source.rank.opr.min' => 5,
'is_duplicate' => 0,
'has_image' => 1,
'sort.by' => 'quality',
'sort.order' => 'desc',
'facet' => 1,
'facet.field' => 'source.id,language.id',
'hl' => 1,
'hl.fl' => 'title,description',
'per_page' => 50,
'api_key' => 'YOUR_API_KEY',
],
]);
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?organization.name=Apple%2CGoogle%2CMicrosoft&title=innovation%2Ctechnology&category.id=medtop%3A04000000&sentiment.overall.polarity=positive&published_at.start=2024-01-01&source.rank.opr.min=5&is_duplicate=0&has_image=1&sort.by=quality&sort.order=desc&facet=1&facet.field=source.id%2Clanguage.id&hl=1&hl.fl=title%2Cdescription&per_page=50&api_key=YOUR_API_KEY")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();