ทุกคำร้องขอ API ต้องส่ง ?api_key=YOUR_KEY
หากไม่มี หรือใส่ผิด จะได้รับ { success: false, error: "Invalid or missing API key" }
{
"success": true,
"count": 1,
"quotes": [
{
"id": 12,
"quote": "จงใช้ชีวิตในแบบของคุณ",
"quote_en": "Live your own life",
"author": "นิรนาม",
"image": "uploads/123abc.jpg",
"category": "แรงบันดาลใจ"
}
]
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://k.omiomi.xyz/api/quotes.php?api_key=YOUR_KEY&limit=3');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$data = json_decode($res, true);
print_r($data);
fetch('https://k.omiomi.xyz/api/quotes.php?api_key=YOUR_KEY&limit=3')
.then(res => res.json())
.then(data => console.log(data));
import requests
res = requests.get('https://k.omiomi.xyz/api/quotes.php?api_key=YOUR_KEY&limit=3')
print(res.json())
curl "https://k.omiomi.xyz/api/quotes.php?api_key=YOUR_KEY&limit=3"
© 2025 k.omiomi.xyz — เว็บไซต์คำคมแรกของไทยที่ให้ใช้งาน API ได้ฟรี