การดึงชุดข้อมูลขนาดใหญ่พร้อมการเลือกฟิลด์

ดึงชุดข้อมูลขนาดใหญ่โดยใช้การเลือกฟิลด์ การแบ่งหน้า และการกรอง

พารามิเตอร์อินพุต

พารามิเตอร์คำอธิบายประเภทค่าเริ่มต้นจำเป็น
category.idตัวกรองหมวดหมู่stringใช่
published_at.startตัวกรองวันที่เริ่มต้นstringใช่
published_at.endตัวกรองวันที่สิ้นสุดstringใช่
per_pageบทความต่อหน้า (100 สำหรับชุดข้อมูลขนาดใหญ่)integer100ใช่
pageหมายเลขหน้าสำหรับการแบ่งหน้าinteger1ใช่
sort.byจัดเรียงตามวันที่เผยแพร่stringใช่
sort.orderลำดับจากมากไปน้อยstringใช่
flการเลือกฟิลด์เพื่อการปรับปรุงประสิทธิภาพstringใช่
api_keyคีย์ API ของคุณstringใช่

ตัวอย่างขั้นตอนการทำงาน

การดึงข้อมูลชุดข้อมูลขนาดใหญ่ที่มีประสิทธิภาพ:
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&published_at.start=2023-01-01&published_at.end=2023-12-31&per_page=100&page=1&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"
การเพิ่มประสิทธิภาพการทำงานสำหรับชุดข้อมูลขนาดใหญ่:
curl -X GET "https://api.apitube.io/v1/news/everything?fl=id,title,source.domain&per_page=100&published_at.start=2024-01-01&api_key=YOUR_API_KEY"
การค้นหาแบบแบ่งหน้าด้วยหลายเกณฑ์:
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Amazon&sentiment.overall.polarity=positive&per_page=25&page=3&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"

ตัวอย่างที่เกี่ยวข้อง

สูตรสำหรับ cURL

curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?category.id=medtop%3A13000000&published_at.start=2023-01-01&published_at.end=2023-12-31&per_page=100&page=1&sort.by=published_at&sort.order=desc&fl=id%2Ctitle%2Cpublished_at%2Csource.domain&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:13000000",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "per_page": 100,
    "page": 1,
    "sort.by": "published_at",
    "sort.order": "desc",
    "fl": "id,title,published_at,source.domain",
    "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:13000000",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "per_page": 100,
    "page": 1,
    "sort.by": "published_at",
    "sort.order": "desc",
    "fl": "id,title,published_at,source.domain",
    "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:13000000',
    'published_at.start' => '2023-01-01',
    'published_at.end' => '2023-12-31',
    'per_page' => 100,
    'page' => 1,
    'sort.by' => 'published_at',
    'sort.order' => 'desc',
    'fl' => 'id,title,published_at,source.domain',
    '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%3A13000000&published_at.start=2023-01-01&published_at.end=2023-12-31&per_page=100&page=1&sort.by=published_at&sort.order=desc&fl=id%2Ctitle%2Cpublished_at%2Csource.domain&api_key=YOUR_API_KEY")
		.method("POST", body)
		.addHeader("Content-Type", "application/json")
		.build();
Response response = client.newCall(request).execute();
		
  • CNN
  • Techcrunch
  • Vox
  • Apple
  • Microsoft
  • IBM
  • Bloomberg
  • Spotify
เราใช้คุกกี้

โดยการคลิก "ยอมรับ" คุณยอมรับคุกกี้บนอุปกรณ์ของคุณเพื่อให้เว็บไซต์ทำงานได้และเพื่อการวิเคราะห์