การวิเคราะห์อนุกรมเวลาของหมวดหมู่พร้อมการกรองสื่อ
วิเคราะห์บทความในหมวดหมู่เมื่อเวลาผ่านไปพร้อมข้อกำหนดสื่อและการกรองคุณภาพแหล่งข่าว
พารามิเตอร์อินพุต
| พารามิเตอร์ | คำอธิบาย | ประเภท | ค่าเริ่มต้น | จำเป็น |
|---|---|---|---|---|
| category.id | ตัวกรองหมวดหมู่ | string | ใช่ | |
| published_at.start | วันที่เริ่มต้นสำหรับช่วงเวลา | string | ใช่ | |
| published_at.end | วันที่สิ้นสุดสำหรับช่วงเวลา | string | ใช่ | |
| sort.by | จัดเรียงตามวันที่เผยแพร่ | string | ใช่ | |
| sort.order | ลำดับจากน้อยไปมากสำหรับไทม์ไลน์ | string | ใช่ | |
| per_page | จำนวนบทความสูงสุด (100 สำหรับอนุกรมเวลา) | integer | 100 | ใช่ |
| media.images.count | จำนวนรูปภาพขั้นต่ำ | integer | ใช่ | |
| source.rank.opr.min | คุณภาพแหล่งข่าวขั้นต่ำ | string | ใช่ | |
| api_key | คีย์ API ของคุณ | string | ใช่ |
ตัวอย่างขั้นตอนการทำงาน
คำขอสำหรับการวิเคราะห์อนุกรมเวลาตามหมวดหมู่:
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"
คำขอสำหรับการวิเคราะห์สื่อตามหมวดหมู่:
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:01000000&media.images.count=3&source.rank.opr.min=6&published_at.start=2023-01-01&sort.by=media.images.count&sort.order=desc&api_key=YOUR_API_KEY"
เปรียบเทียบว่าความครอบคลุมเป็นบวก ลบ หรือเป็นกลางในหมวดหมู่ต่างๆ:
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:20000003,medtop:11000000,medtop:20000607&sentiment.overall.polarity=positive&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=category.id&api_key=YOUR_API_KEY"
ตัวอย่างที่เกี่ยวข้อง
- รับจำนวนบทความตามฟิลด์สำหรับการวิเคราะห์
- นับจำนวนบทความตามช่วง
- รับข่าวสารในหมวดหมู่ที่กำหนด
- เรียงลำดับตามคะแนนการมีส่วนร่วม
- รับบทความที่มีรูปภาพคุณภาพสูง
สูตรสำหรับ cURL
curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?category.id=medtop%3A04000000&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=published_at&sort.order=asc&per_page=100&media.images.count=3&source.rank.opr.min=6&api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json'
สูตรสำหรับ Python
import requests
url = "https://api.apitube.io/v1/news/everything"
querystring = {
"category.id": "medtop:04000000",
"published_at.start": "2023-01-01",
"published_at.end": "2023-12-31",
"sort.by": "published_at",
"sort.order": "asc",
"per_page": 100,
"media.images.count": 3,
"source.rank.opr.min": 6,
"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: {
"category.id": "medtop:04000000",
"published_at.start": "2023-01-01",
"published_at.end": "2023-12-31",
"sort.by": "published_at",
"sort.order": "asc",
"per_page": 100,
"media.images.count": 3,
"source.rank.opr.min": 6,
"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' => [
'category.id' => 'medtop:04000000',
'published_at.start' => '2023-01-01',
'published_at.end' => '2023-12-31',
'sort.by' => 'published_at',
'sort.order' => 'asc',
'per_page' => 100,
'media.images.count' => 3,
'source.rank.opr.min' => 6,
'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?category.id=medtop%3A04000000&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=published_at&sort.order=asc&per_page=100&media.images.count=3&source.rank.opr.min=6&api_key=YOUR_API_KEY")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();