Calendar API / Kurdish Data

API بۆ داتاى کۆڵەکە و هەواڵەکانی کوردی

API for Kurdish calendar, events, and poetry data

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.

GET /api/index.php Copied
0 Kurdish months
0 Events
0 Poems
JSON Standard output

JavaScript

fetch()

In JavaScript you can fetch the data and read the month name, events, and poems directly.

Month: data.months[1].name
Events: data.months[1].events
Poems: data.poems
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);
  });
Example response
JSON
{
    "months": {
        "1": {
            "number": 1,
            "name": "خاکەلێوە",
            "events": [{ "id": 2111, "title": "نەورۆز" }]
        }
    },
    "poems": []
}

PHP

json_decode()

In PHP, you can read the JSON file and decode it with json_decode() to access month names, events, and poems.

Month: $data['months'][1]['name']
Events: data['months'][1]['events']
Poems: $data['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'];
Example response
JSON
{
    "months": {
        "1": {
            "number": 1,
            "name": "خاکەلێوە",
            "events": [{ "id": 2111, "title": "نەورۆز" }]
        }
    },
    "poems": []
}

Python

requests

In Python, you can retrieve the API response with requests and work with the returned dictionary.

Month: data['months'][1]['name']
Events: data['months'][1]['events']
Poems: data['poems']
import requests

res = requests.get('http://localhost/api/index.php').json()
month = res['months'][1]
print(month['name'])
print(month['events'])
print(res['poems'])
Example response
JSON
{
    "months": {
        "1": {
            "number": 1,
            "name": "خاکەلێوە",
            "events": [{ "id": 2111, "title": "نەورۆز" }]
        }
    },
    "poems": []
}

Node.js

fetch()

In Node.js you can call the API and consume the returned JSON object in your application.

Month: data.months[1].name
Events: data.months[1].events
Poems: data.poems
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);
Example response
JSON
{
    "months": {
        "1": {
            "number": 1,
            "name": "خاکەلێوە",
            "events": [{ "id": 2111, "title": "نەورۆز" }]
        }
    },
    "poems": []
}

React

useEffect()

In React, you can fetch the API and render month names, events, and poems in components.

Month: months[1].name
Events: months[1].events
Poems: poems
useEffect(() => {
  fetch('/api/index.php')
    .then(r => r.json())
    .then(data => setData(data));
}, []);

const month = data?.months?.[1];
return <h3>{month?.name}</h3>;
Example response
JSON
{
    "months": {
        "1": {
            "number": 1,
            "name": "خاکەلێوە",
            "events": [{ "id": 2111, "title": "نەورۆز" }]
        }
    },
    "poems": []
}