ئەم APIیە داتاى ناو ماوەکان، نامەی مانگان، بۆنەکان و شیعرەکان بەشێوەی JSON بۆ دەستگەیشتن و بەکارهێنانی ئەپلیکەیشنەکان، وێب سایتەکان و داشبۆردەکان دابین دەکات. دەتوانرێت بە ئاسانی لە سەر فرانت ئەند یان باک ئەند بەکار بهێنرێت.
This API provides month names, calendar events, and poems in JSON format for use in apps, websites, dashboards, and custom integrations. It can be easily consumed in frontend or backend projects.
لە جاڤاکریپتدا دەتوانیت بە fetch() داتا بگەرێنیت و ناوی مانگ، بۆنەکان و شیعرەکان بگەرێنیت.
In JavaScript you can fetch the data and read the month name, events, and poems directly.
fetch('/api/index.php')
.then(r => r.json())
.then(data => {
const month = data.months[1];
console.log(month.name);
console.log(month.events);
console.log(data.poems);
});
{
"months": {
"1": {
"number": 1,
"name": "خاکەلێوە",
"events": [{ "id": 2111, "title": "نەورۆز" }]
}
},
"poems": []
}
لە PHPدا دەتوانیت فایل JSON بکەیتەوە و بە json_decode() داتاکە وەربگریت و بە شێوەی ئەرەستەیەک بەکار بهێنیت.
In PHP, you can read the JSON file and decode it with json_decode() to access month names, events, and poems.
$json = file_get_contents('/api/data.json');
$data = json_decode($json, true);
$month = $data['months'][1];
foreach ($month['events'] as $event) {
echo $event['title'] . PHP_EOL;
}
echo $data['poems'][0]['poet'];
{
"months": {
"1": {
"number": 1,
"name": "خاکەلێوە",
"events": [{ "id": 2111, "title": "نەورۆز" }]
}
},
"poems": []
}
لە پایتەندا دەتوانیت وەڵامی API بە requests بکەیت و داتاکە بە dictionary لێک بکەیت.
In Python, you can retrieve the API response with requests and work with the returned dictionary.
import requests
res = requests.get('http://localhost/api/index.php').json()
month = res['months'][1]
print(month['name'])
print(month['events'])
print(res['poems'])
{
"months": {
"1": {
"number": 1,
"name": "خاکەلێوە",
"events": [{ "id": 2111, "title": "نەورۆز" }]
}
},
"poems": []
}
لە Node.jsدا دەتوانیت داواکارییەک لە API بکەیت و زانیارییەکان بۆ پڕۆژەکەت بەکار بهێنیت.
In Node.js you can call the API and consume the returned JSON object in your application.
const res = await fetch('http://localhost/api/index.php');
const data = await res.json();
const month = data.months[1];
console.log(month.name);
console.log(month.events);
console.log(data.poems);
{
"months": {
"1": {
"number": 1,
"name": "خاکەلێوە",
"events": [{ "id": 2111, "title": "نەورۆز" }]
}
},
"poems": []
}
لە Reactدا دەتوانیت داتا بکەیتەوە و بە state یان component هەموو زانیارییەکان پیشان بدەیت.
In React, you can fetch the API and render month names, events, and poems in components.
useEffect(() => {
fetch('/api/index.php')
.then(r => r.json())
.then(data => setData(data));
}, []);
const month = data?.months?.[1];
return <h3>{month?.name}</h3>;
{
"months": {
"1": {
"number": 1,
"name": "خاکەلێوە",
"events": [{ "id": 2111, "title": "نەورۆز" }]
}
},
"poems": []
}