监控多种语言的新闻,并跟踪报道是积极、消极还是中立

监控多种语言的新闻。查看报道是积极、消极还是中立。按来源质量和时间过滤

输入参数

参数描述类型默认必需
language.code多种语言(逗号分隔)。string是
title搜索查询。string是
sentiment.overall.polarity按情绪过滤。string是
published_at.start开始日期过滤器。string是
source.rank.opr.min最小来源质量。string是
sort.by按发布日期排序。string是
sort.order降序。string是
facet按字段计数文章。booleantrue是
facet.field用于分组统计文章数量的字段。string是
api_key您的 API 密钥string是
per_page要检索的最大文章数integer40否

工作流程示例

多语言新闻监控:
curl -X GET "https://api.apitube.io/v1/news/everything?language.code=en,ja,de,fr&title=AI&sentiment.overall.polarity=positive&published_at.start=2023-01-01&published_at.end=2023-01-31&source.rank.opr.min=5&sort.by=published_at&sort.order=desc&facet=true&facet.field=language.id,source.country.id&api_key=YOUR_API_KEY"
带来源过滤的多语言分析:
curl -X GET "https://api.apitube.io/v1/news/everything?language.code=en,ja,de&source.rank.opr.min=5&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"
特定语言的商业新闻:
curl -X GET "https://api.apitube.io/v1/news/everything?language.code=zh,ko&category.id=medtop:04000000&published_at.start=2023-01-01&api_key=YOUR_API_KEY"

相关示例

食谱 cURL

curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?language.code=en%2Cja%2Cde%2Cfr&title=AI&sentiment.overall.polarity=positive&published_at.start=2023-01-01&source.rank.opr.min=5&sort.by=published_at&sort.order=desc&facet=1&facet.field=language.id%2Csource.country.id&api_key=YOUR_API_KEY&per_page=40' \
--header 'Content-Type: application/json'

食谱 Python

import requests

url = "https://api.apitube.io/v1/news/everything"

querystring = {
    "language.code": "en,ja,de,fr",
    "title": "AI",
    "sentiment.overall.polarity": "positive",
    "published_at.start": "2023-01-01",
    "source.rank.opr.min": 5,
    "sort.by": "published_at",
    "sort.order": "desc",
    "facet": true,
    "facet.field": "language.id,source.country.id",
    "api_key": "YOUR_API_KEY",
    "per_page": 40
}
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: {
    "language.code": "en,ja,de,fr",
    "title": "AI",
    "sentiment.overall.polarity": "positive",
    "published_at.start": "2023-01-01",
    "source.rank.opr.min": 5,
    "sort.by": "published_at",
    "sort.order": "desc",
    "facet": true,
    "facet.field": "language.id,source.country.id",
    "api_key": "YOUR_API_KEY",
    "per_page": 40
}};

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' => [
    'language.code' => 'en,ja,de,fr',
    'title' => 'AI',
    'sentiment.overall.polarity' => 'positive',
    'published_at.start' => '2023-01-01',
    'source.rank.opr.min' => 5,
    'sort.by' => 'published_at',
    'sort.order' => 'desc',
    'facet' => 1,
    'facet.field' => 'language.id,source.country.id',
    'api_key' => 'YOUR_API_KEY',
    'per_page' => 40,
],
]);

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?language.code=en%2Cja%2Cde%2Cfr&title=AI&sentiment.overall.polarity=positive&published_at.start=2023-01-01&source.rank.opr.min=5&sort.by=published_at&sort.order=desc&facet=1&facet.field=language.id%2Csource.country.id&api_key=YOUR_API_KEY&per_page=40")
		.method("POST", body)
		.addHeader("Content-Type", "application/json")
		.build();
Response response = client.newCall(request).execute();
		
  • CNN
  • Techcrunch
  • Vox
  • Apple
  • Microsoft
  • IBM
  • Bloomberg
  • Spotify
我们使用 Cookie

点击“接受”即表示您同意在您的设备上使用 Cookie,以使网站正常运行并用于分析。