ข่าวเด่นเรียงตามการมีส่วนร่วม พร้อมรูปภาพและวิดีโอ
เรียงลำดับข่าวด่วนตามศักยภาพการมีส่วนร่วม กรองตามข้อกำหนดสื่อและคุณภาพแหล่งที่มา
พารามิเตอร์อินพุต
| พารามิเตอร์ | คำอธิบาย | ประเภท | ค่าเริ่มต้น | จำเป็น |
|---|---|---|---|---|
| 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();