การวิเคราะห์อคติสื่อข้ามภูมิภาค
เปรียบเทียบว่าภูมิภาคต่างๆ ครอบคลุมหัวข้อเฉพาะอย่างไร แสดงว่าความครอบคลุมเป็นบวก ลบ หรือเป็นกลาง และกรองตามช่วงวันที่
พารามิเตอร์อินพุต
| พารามิเตอร์ | คำอธิบาย | ประเภท | ค่าเริ่มต้น | จำเป็น |
|---|---|---|---|---|
| title | ค้นหาหัวข้อ | string | ใช่ | |
| source.country.code | รหัสประเทศหลายรหัส (คั่นด้วยจุลภาค) | string | ใช่ | |
| sort.by | จัดเรียงตามคะแนนความรู้สึก | string | ใช่ | |
| published_at.start | ตัวกรองวันที่เริ่มต้น | string | ใช่ | |
| published_at.end | ตัวกรองวันที่สิ้นสุด | string | ใช่ | |
| facet | นับจำนวนบทความตามฟิลด์ | boolean | true | ใช่ |
| facet.field | ฟิลด์ที่ใช้จัดกลุ่มและนับจำนวนบทความ | string | ใช่ | |
| api_key | คีย์ API ของคุณ | string | ใช่ | |
| per_page | จำนวนบทความสูงสุดที่จะดึง | integer | 50 | ไม่ |
ตัวอย่างขั้นตอนการทำงาน
การวิเคราะห์อคติสื่อข้ามภูมิภาค:
curl -X GET "https://api.apitube.io/v1/news/everything?title=climate%20change&source.country.code=us,cn,in&sort.by=sentiment.overall.score&published_at.start=2023-01-01&published_at.end=2023-01-31&api_key=YOUR_API_KEY"
การกระจายอคติของสื่อ:
curl -X GET "https://api.apitube.io/v1/news/everything?title=climate%20change&facet=true&facet.field=source.bias,source.country.id&api_key=YOUR_API_KEY"
ตัวอย่างที่เกี่ยวข้อง
- นับจำนวนผลลัพธ์ที่จัดกลุ่มด้วยตัวกรองหลายรายการ
- วิเคราะห์ข่าวเกี่ยวกับเหตุการณ์ภูมิรัฐศาสตร์
- รับจำนวนบทความตามฟิลด์สำหรับการวิเคราะห์
- ค้นหาว่าบุคคลนั้นถูกกล่าวถึงร่วมกับองค์กรใดบ้าง
- เรียงลำดับตามคะแนนการมีส่วนร่วม
สูตรสำหรับ cURL
curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?title=climate+change&source.country.code=us%2Ccn%2Cin&sort.by=sentiment.overall.score&published_at.start=2023-01-01&published_at.end=2023-12-31&facet=1&facet.field=source.bias%2Csource.country.id&api_key=YOUR_API_KEY&per_page=50' \
--header 'Content-Type: application/json'
สูตรสำหรับ Python
import requests
url = "https://api.apitube.io/v1/news/everything"
querystring = {
"title": "climate change",
"source.country.code": "us,cn,in",
"sort.by": "sentiment.overall.score",
"published_at.start": "2023-01-01",
"published_at.end": "2023-12-31",
"facet": true,
"facet.field": "source.bias,source.country.id",
"api_key": "YOUR_API_KEY",
"per_page": 50
}
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: {
"title": "climate change",
"source.country.code": "us,cn,in",
"sort.by": "sentiment.overall.score",
"published_at.start": "2023-01-01",
"published_at.end": "2023-12-31",
"facet": true,
"facet.field": "source.bias,source.country.id",
"api_key": "YOUR_API_KEY",
"per_page": 50
}};
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' => [
'title' => 'climate change',
'source.country.code' => 'us,cn,in',
'sort.by' => 'sentiment.overall.score',
'published_at.start' => '2023-01-01',
'published_at.end' => '2023-12-31',
'facet' => 1,
'facet.field' => 'source.bias,source.country.id',
'api_key' => 'YOUR_API_KEY',
'per_page' => 50,
],
]);
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?title=climate+change&source.country.code=us%2Ccn%2Cin&sort.by=sentiment.overall.score&published_at.start=2023-01-01&published_at.end=2023-12-31&facet=1&facet.field=source.bias%2Csource.country.id&api_key=YOUR_API_KEY&per_page=50")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();