توثيق البرمجية (API Documentation)

مرحباً بك في توثيق API الخاص بـ Haya Cloud APIs. يوفر هذا الـ API وصولاً فورياً لبيانات كرة القدم.

BASE URL https://hayachoout.space/api/get

المصادقة (Authentication)

المصادقة مطلوبة لجميع طلبات الـ API. يمكنك التحقق باستخدام ترويسة HTTP مخصصة أو عبر معامل في الرابط.

1. ترويسة HTTP (الخيار الموصى به)

Tip
يُنصح باستخدام X-API-Key في ترويسة الطلب كأفضل ممارسة أمنية، بدلاً من إرسال المفتاح عبر الرابط.
Request Header
X-API-Key: YOUR_API_KEY_HERE

2. معامل الرابط (Query Parameter)

مرر مفتاح الـ API باستخدام معامل api_key في الرابط.

GET Request
GET /api/get?api_key=YOUR_API_KEY_HERE&action=matches

استجابة "غير مصرح به" (Unauthorized Response)

إذا كان مفتاح الـ API مفقوداً أو غير صالح، ستتلقى استجابة 401 Unauthorized.

JSON Response
{
  "status": "error",
  "message": "Unauthorized: Invalid API Key"
}

مثال PHP (الطريقة الموصى بها)

PHP (cURL)
<?php

$apiKey = "YOUR_API_KEY";
$url    = "https://hayachoout.space/api/get?action=matches";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        "X-API-Key: {$apiKey}"
    ],
]);

$response = curl_exec($ch);
curl_close($ch);
echo $response;

?>

قائمة المباريات (Matches List)

GET ?action=matches&date=2026-02-21
Tip
جلب قائمة المباريات لتاريخ محدد مع جميع البيانات الأساسية والروابط.
Timezone by Visitor
Pass one of these values when you want match times to follow the visitor who is requesting your site:
  • X-Timezone or timezone if you already know the exact timezone.
  • X-Country-Code or country_code if you only know the visitor country.
  • X-Forwarded-For or CF-Connecting-IP only when you also send X-Auto-Timezone: ip or auto_timezone=ip.
Resolution order: timezone then country_code then visitor IP when explicitly enabled. If you do not pass any timezone hints, the API returns times in UTC by default. If your website calls the API from its own backend, you must forward the visitor timezone or country. Forward visitor IP only when you intentionally enable IP-based timezone detection.
المعامل (Parameter) النوع (Type) مطلوب (Required) الوصف (Description)
date String لا صيغة YYYY-MM-DD (الافتراضي: تاريخ اليوم)

مثال لاستجابة JSON

JSON Response
{
  "status": "success",
  "date": "2026-02-21",
  "count": 3,
  "data": [
    {
      "id": 1024,
      "home_team": "الأهلي",
      "away_team": "الزمالك",
      "home_score": 2,
      "away_score": 1,
      "match_status": "Finished",
      "match_time": "67'",
      "details_match_time": "13:45",
      "league_name": "الدوري المصري",
      "home_logo": "https://example.com/logos/ahly.png",
      "away_logo": "https://example.com/logos/zamalek.png",
      "league_logo": "https://example.com/logos/epl.png"
    },
    // ... more matches
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey        = "YOUR_API_KEY";
$date          = "2026-02-21";
$viewerIp      = $_SERVER['REMOTE_ADDR'] ?? "8.8.8.8";
$viewerCountry = $_SERVER['HTTP_CF_IPCOUNTRY'] ?? "US";
$url           = "https://hayachoout.space/api/get?action=matches&date={$date}";

// Initialize cURL
$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        "X-API-Key: {$apiKey}",
        "Content-Type: application/json",
        "X-Forwarded-For: {$viewerIp}",
        "X-Country-Code: {$viewerCountry}",
        // Optional: "X-Timezone: Asia/Dubai"
        // Optional: "X-Auto-Timezone: ip"
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $data = json_decode($response, true);

    foreach ($data['data'] as $match) {
        echo $match['home_team']
           . " vs "
           . $match['away_team']
           . " — "
           . $match['match_status']
           . "\n";
    }
} else {
    echo "Error: HTTP {$httpCode}\n";
    echo $response;
}

?>

تفاصيل مباراة واحدة (Single Match)

GET ?action=match&id=1024
Tip
إعدادات المباراة الكاملة والبيانات الأساسية، مع إمكانية تضمين جدول الترتيب.
المعامل (Parameter) النوع (Type) مطلوب (Required) الوصف (Description)
id Int نعم المعرف الفريد للمباراة
include_standings Bool لا تضمين جدول الترتيب الدوري

مثال لاستجابة JSON

JSON Response
{
  "status": "success",
  "data": {
    "id": 1024,
    "home_team": "الأهلي",
    "away_team": "الزمالك",
    "home_score": 2,
    "away_score": 1,
    "match_status": "Finished",
    "match_details": {
      "league_name": "الدوري المصري الممتاز",
      "league_logo": "https://example.com/league.png",
      "stadium": "استاد القاهرة الدولي",
      "channel": "OnTime Sports",
      "channel_logo": "https://example.com/channel.png",
      "referee": "محمود البنا",
      "match_time": "67'",
      "details_match_time": "13:45",
      "match_date": "2026-02-22"
    },
    "home_logo": "https://example.com/logos/ahly.png",
    "away_logo": "https://example.com/logos/zamalek.png",
    "lineup_home": "{\"formation\":\"4-3-3\",\"starting\":[...],\"substitutes\":[...]}",
    "lineup_away": "{\"formation\":\"4-4-2\",\"starting\":[...],\"substitutes\":[...]}",
    "events": [
      {
        "event_minute": "23",
        "event_type": "Goal",
        "player_name": "M. Salah",
        "player_name_ar": "محمد صلاح",
        "player_name_en": "Mohamed Salah"
      },
      // ... more events
    ],
    "standings": [ // only if include_standings=true
      {
        "team_name": "الأهلي",
        "played": 18,
        "won": 14,
        "drawn": 3,
        "lost": 1,
        "points": 45
      }
    ]
  }
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey  = "YOUR_API_KEY";
$matchId = 1024;
$url     = "https://hayachoout.space/api/get?action=match&id={$matchId}&include_standings=true";

// Initialize cURL
$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        "X-API-Key: {$apiKey}",
        "Content-Type: application/json"
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $data = json_decode($response, true);
    $match = $data['data'];

    echo $match['home_team']
       . " {$match['home_score']} - {$match['away_score']} "
       . $match['away_team'] . "\n";

    // Display events
    if (isset($match['events'])) {
        foreach ($match['events'] as $event) {
            echo "  ⚽ {$event['event_minute']}' — {$event['player_name']}\n";
        }
    }
} else {
    echo "Error: HTTP {$httpCode}\n";
}

?>

أحداث المباراة (Match Events)

GET ?action=match&id=1024 → events[]
Tip
يتم إرجاع الأحداث داخل استجابة المباراة كمصفوفة events، وتتضمن الأهداف، البطاقات، والتبديلات.

مثال لاستجابة JSON

JSON Response — events[]
[
  {
    "match_id": "87",
    "event_type": "GOAL",
    "event_minute": "21",
    "team_side": "home",
    "player_name": "ويليام ساليبا",
    "player_name_secondary": "غابرييل ماجاليس",
    "event_details": "هدف",
    "event_order": 0
  },
  {
    "match_id": "87",
    "event_type": "OWN_GOAL",
    "event_minute": "45+3",
    "team_side": "away",
    "player_name": "بييرو هينكابي",
    "player_name_secondary": "",
    "event_details": "هدف في مرماه",
    "event_order": 1
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "56",
    "team_side": "home",
    "player_name": "لياندرو تروسارد",
    "player_name_secondary": "غابرييل مارتينيلي",
    "event_details": "تبديل لاعب",
    "event_order": 2
  },
  {
    "match_id": "87",
    "event_type": "CARD_YELLOW",
    "event_minute": "59",
    "team_side": "away",
    "player_name": "كول بالمر",
    "player_name_secondary": "",
    "event_details": "بطاقة صفراء",
    "event_order": 3
  },
  {
    "match_id": "87",
    "event_type": "CARD_YELLOW",
    "event_minute": "65",
    "team_side": "away",
    "player_name": "جوريل هاتو",
    "player_name_secondary": "",
    "event_details": "بطاقة صفراء",
    "event_order": 4
  },
  {
    "match_id": "87",
    "event_type": "GOAL",
    "event_minute": "66",
    "team_side": "home",
    "player_name": "يوريان تمبر",
    "player_name_secondary": "ديكلان رايس",
    "event_details": "هدف",
    "event_order": 5
  },
  {
    "match_id": "87",
    "event_type": "CARD_YELLOW",
    "event_minute": "68",
    "team_side": "away",
    "player_name": "بيدرو نيتو",
    "player_name_secondary": "",
    "event_details": "بطاقة صفراء",
    "event_order": 6
  },
  {
    "match_id": "87",
    "event_type": "CARD_RED",
    "event_minute": "70",
    "team_side": "away",
    "player_name": "بيدرو نيتو",
    "player_name_secondary": "",
    "event_details": "بطاقة حمراء",
    "event_order": 7
  },
  {
    "match_id": "87",
    "event_type": "CARD_YELLOW",
    "event_minute": "75",
    "team_side": "home",
    "player_name": "غابرييل ماجاليس",
    "player_name_secondary": "",
    "event_details": "بطاقة صفراء",
    "event_order": 8
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "76",
    "team_side": "home",
    "player_name": "ديكلان رايس",
    "player_name_secondary": "كريستيان نورغارد",
    "event_details": "تبديل لاعب",
    "event_order": 9
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "76",
    "team_side": "home",
    "player_name": "فيكتور غيوكيرس",
    "player_name_secondary": "كاي هافيرتز",
    "event_details": "تبديل لاعب",
    "event_order": 10
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "76",
    "team_side": "away",
    "player_name": "جوريل هاتو",
    "player_name_secondary": "مالو غوستو",
    "event_details": "تبديل لاعب",
    "event_order": 11
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "76",
    "team_side": "away",
    "player_name": "أندري سانتوس",
    "player_name_secondary": "روميو لافيا",
    "event_details": "تبديل لاعب",
    "event_order": 12
  },
  {
    "match_id": "87",
    "event_type": "CARD_YELLOW",
    "event_minute": "79",
    "team_side": "away",
    "player_name": "إنزو فرنانديز",
    "player_name_secondary": "",
    "event_details": "بطاقة صفراء",
    "event_order": 13
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "85",
    "team_side": "away",
    "player_name": "إنزو فرنانديز",
    "player_name_secondary": "ليام ديلاب",
    "event_details": "تبديل لاعب",
    "event_order": 14
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "86",
    "team_side": "away",
    "player_name": "كول بالمر",
    "player_name_secondary": "أليخاندرو جارناتشو",
    "event_details": "تبديل لاعب",
    "event_order": 15
  },
  {
    "match_id": "87",
    "event_type": "SUBSTITUTION",
    "event_minute": "90",
    "team_side": "away",
    "player_name": "مامادو سار",
    "player_name_secondary": "توسين أدارابيويو",
    "event_details": "تبديل لاعب",
    "event_order": 16
  },
  {
    "match_id": "87",
    "event_type": "GOAL_VAR_CANCELLED",
    "event_minute": "90+5",
    "team_side": "away",
    "player_name": "ليام ديلاب",
    "player_name_secondary": "",
    "event_details": "هدف ملغي",
    "event_order": 17
  }
]

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey  = "YOUR_API_KEY";
$matchId = 1024;
$url     = "https://hayachoout.space/api/get?action=match&id={$matchId}";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data  = json_decode($response, true);
$match = $data['data'];

if (isset($match['events'])) {
    foreach ($match['events'] as $event) {
        $icon = match($event['event_type']) {
            'Goal'         => '⚽',
            'Yellow Card'  => '🟨',
            'Red Card'     => '🟥',
            'Substitution' => '🔄',
            default        => '📌',
        };

        $player = $event['player_name_ar'] ?? $event['player_name'];
        echo "{$icon} {$event['event_minute']}' — {$player}\n";
    }
} else {
    echo "No events available for this match.\n";
}

?>

تشكيلات الفريق (Match Lineups)

GET ?action=match&id=1024 → lineup_home / lineup_away
Tip
تتضمن التشكيلة الخطة، التشكيلة الأساسية، البدلاء، اللاعبين الغائبين، وبيانات المدرب مع الصور.

مثال لاستجابة JSON

JSON — lineup_home (decoded)
{
  "formation": "4-2-3-1",
  "team_name_ar": "إيفرتون",
  "team_name_en": "Everton",
  "team_logo": "https://cdn.sportfeeds.io/.../medium/team.png",
  "coach": "ديفيد مويس",
  "coach_ar": "ديفيد مويس",
  "coach_en": "David Moyes",
  "coach_image": "https://cdn.sportfeeds.io/.../medium/12345.png",
  "starting": [
    {
      "name": "جوردان بيكفورد",
      "name_ar": "جوردان بيكفورد",
      "name_en": "Jordan Pickford",
      "number": 1,
      "position": { "x": 50, "y": 12 },
      "position_en": null,
      "id": "e8dina16u5kt5ho4u5igtmimt",
      "image": "https://cdn.sportfeeds.io/.../medium/e8dina...png",
      "is_captain": false,
      "events": []
    },
    {
      "name": "ناتان باترسون",
      "number": 2,
      "position": { "x": 13, "y": 38 },
      "is_captain": false,
      // ...
    },
    // ... 9 more starting players
  ],
  "substitutes": [
    {
      "name": "M. Sherif",
      "name_ar": "محمد شريف",
      "name_en": "Mohamed Sherif",
      "number": 9,
      "image": "https://cdn.sportfeeds.io/.../medium/54321.png"
    },
    // ... more substitutes
  ],
  "injuries": [
    {
      "name": "جاك جريليش",
      "name_ar": "جاك جريليش",
      "name_en": "Jack Grealish",
      "reason": null,
      "image": "https://cdn.sportfeeds.io/.../medium/abc.png"
    }
  ],
  "suspensions": [
    {
      "name": "جيك أوبراين",
      "name_ar": "جيك أوبراين",
      "reason": null,
      "image": "https://cdn.sportfeeds.io/.../medium/default.png"
    }
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey  = "YOUR_API_KEY";
$matchId = 1024;
$url     = "https://hayachoout.space/api/get?action=match&id={$matchId}";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data  = json_decode($response, true);
$match = $data['data'];

// Decode home lineup
$homeLineup = json_decode($match['lineup_home'], true);

echo "📋 Formation: {$homeLineup['formation']}\n";
echo "🧑‍💼 Coach: {$homeLineup['coach']}\n\n";

// Starting XI
echo "⭐ Starting XI:\n";
foreach ($homeLineup['starting'] as $player) {
    $name = $player['name_ar'] ?? $player['name'];
    $pos  = "x:{$player['position']['x']}, y:{$player['position']['y']}";
    echo "  #{$player['number']} {$name} ({$pos})\n";
}

// Substitutes
if (!empty($homeLineup['substitutes'])) {
    echo "\n🔄 Substitutes:\n";
    foreach ($homeLineup['substitutes'] as $player) {
        $name = $player['name_ar'] ?? $player['name'];
        echo "  #{$player['number']} {$name}\n";
    }
}

// Injuries
if (!empty($homeLineup['injuries'])) {
    echo "\n🏥 Injuries:\n";
    foreach ($homeLineup['injuries'] as $player) {
        echo "  ❌ {$player['name']}\n";
    }
}

// Suspensions
if (!empty($homeLineup['suspensions'])) {
    echo "\n🟥 Suspensions:\n";
    foreach ($homeLineup['suspensions'] as $player) {
        echo "  🚫 {$player['name']}\n";
    }
}

?>

إحصائيات المباراة (Match Stats)

GET ?action=match&id=1024 → statistics_data
Tip
يتم تخزين الإحصائيات (الاستحواذ، التسديدات، الركنيات) كسلسلة JSON مشفرة في حقل statistics_data.

مثال لاستجابة JSON

JSON — statistics_data (decoded)
[
  {
    "type": "الاستحواذ",
    "home": "58%",
    "away": "42%"
  },
  {
    "type": "إجمالي التسديدات",
    "home": "16",
    "away": "8"
  },
  {
    "type": "التسديدات على المرمى",
    "home": "7",
    "away": "3"
  },
  {
    "type": "التسديدات خارج المرمى",
    "home": "6",
    "away": "3"
  },
  {
    "type": "تسديدات تم اعتراضها",
    "home": "3",
    "away": "2"
  },
  {
    "type": "الركلات الركنية",
    "home": "8",
    "away": "2"
  },
  {
    "type": "التسلل",
    "home": "3",
    "away": "1"
  },
  {
    "type": "التصديات",
    "home": "2",
    "away": "5"
  },
  {
    "type": "الأخطاء المرتكبة",
    "home": "11",
    "away": "14"
  },
  {
    "type": "البطاقات الصفراء",
    "home": "1",
    "away": "5"
  },
  {
    "type": "البطاقات الحمراء",
    "home": "0",
    "away": "1"
  },
  {
    "type": "فرص خطيرة",
    "home": "4",
    "away": "1"
  },
  {
    "type": "إجمالي التمريرات",
    "home": "542",
    "away": "398"
  },
  {
    "type": "دقة التمرير",
    "home": "86% (466/542)",
    "away": "79% (314/398)"
  },
  {
    "type": "تمريرات مفتاحية",
    "home": "12",
    "away": "6"
  },
  {
    "type": "كرات عرضية",
    "home": "22% (5/23)",
    "away": "18% (2/11)"
  },
  {
    "type": "كرات طويلة",
    "home": "52% (26/50)",
    "away": "41% (25/61)"
  },
  {
    "type": "المراوغات الناجحة",
    "home": "62% (8/13)",
    "away": "44% (4/9)"
  },
  {
    "type": "الالتحامات الناجحة",
    "home": "51",
    "away": "48"
  },
  {
    "type": "الالتحامات الهوائية",
    "home": "12",
    "away": "10"
  },
  {
    "type": "التدخلات (Tackles)",
    "home": "15",
    "away": "19"
  },
  {
    "type": "قطع الكرات (Interceptions)",
    "home": "9",
    "away": "12"
  },
  {
    "type": "تشتيت الكرة (Clearances)",
    "home": "14",
    "away": "22"
  }
]

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey  = "YOUR_API_KEY";
$matchId = 1024;
$url     = "https://hayachoout.space/api/get?action=match&id={$matchId}";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data  = json_decode($response, true);
$match = $data['data'];

// Decode statistics
$stats = json_decode($match['statistics_data'], true);

// Categories: summary, attacking, passing, defence, discipline
$categories = [
    'summary'    => '📊 Summary',
    'attacking'  => '⚽ Attacking',
    'passing'    => '🎯 Passing',
    'defence'    => '🛡️ Defence',
    'discipline' => '🟨 Discipline',
];

foreach ($categories as $key => $title) {
    if (!empty($stats[$key])) {
        echo "\n{$title}\n";
        foreach ($stats[$key] as $stat) {
            echo str_pad($stat['type'], 22)
               . str_pad($stat['teamA'], 8)
               . $stat['teamB'] . "\n";
        }
    }
}

?>

المواجهات السابقة (Previous Meetings)

تاريخ المواجهات المباشرة والنتائج السابقة بين الفريقين.

GET ?action=match&id=1024 → previous_meetings
Tip
يتم إرجاع المواجهات السابقة داخل استجابة تفاصيل المباراة كمصفوفة previous_meetings، مما يسهل عرض التاريخ المباشر دون طلبات إضافية.

مثال لاستجابة JSON

JSON — previous_meetings
{
  "h2h": {
    "matches": [
      { "date": "2025-11-22", "home_team": "نابولي", "away_team": "أتلانتا", "score_home": 3, "score_away": 1, "status": "Finished" },
      // ... 4 more matches
    ],
    "stats": { "teamAWins": 1, "teamBWins": 4, "draws": 0, "teamAGoals": 6, "teamBGoals": 12 }
  },
  "teamA": {
    "results": [
      { "home_team": "دورتموند", "away_team": "أتلانتا", "score_home": 2, "score_away": 0, "result": "LOSE" }
    ],
    "stats": { "wins": 3, "draws": 1, "losses": 1 }
  },
  "teamB": {
    "results": [
      { "home_team": "نابولي", "away_team": "روما", "score_home": 2, "score_away": 2, "result": "DRAW" }
    ],
    "stats": { "wins": 2, "draws": 2, "losses": 1 }
  }
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey  = "YOUR_API_KEY";
$matchId = 1024;
$url     = "https://hayachoout.space/api/get?action=match&id={$matchId}";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data  = json_decode($response, true);
$h2hData = $data['data']['previous_meetings'];

if ($h2hData) {
    // 1. Head to Head Matches
    echo "🤝 H2H Matches:\n";
    foreach ($h2hData['h2h']['matches'] as $m) {
        echo "  {$m['date']}: {$m['home_team']} {$m['score_home']} - {$m['score_away']} {$m['away_team']}\n";
    }

    // 2. Team A (Home) Last Results
    echo "\n🏠 Team A Last Results:\n";
    foreach ($h2hData['teamA']['results'] as $r) {
        echo "  {$r['result']}: {$r['home_team']} {$r['score_home']} - {$r['score_away']} {$r['away_team']}\n";
    }
}

?>

جدول الترتيب (Standings)

GET ?action=standings&match_id=1024
Tip
يعيد جدول الدوري للفريقين المتنافسين في المباراة المحددة، مما يسمح بعرض ترتيبهم الحالي في جدول الدوري.

مثال لاستجابة JSON — لكل مباراة

JSON — action=standings
{
  "status": "success",
  "match_id": "1024",
  "data": [
    {
      "rank": 1,
      "team": "ليفربول",
      "team_name": "ليفربول",
      "played": 26,
      "won": 20,
      "drawn": 4,
      "lost": 2,
      "goals_for": 60,
      "goals_against": 22,
      "goal_diff": 38,
      "points": 64
    },
    {
      "rank": 2,
      "team": "أرسنال",
      "played": 26,
      "won": 17,
      "drawn": 6,
      "lost": 3,
      "goals_for": 52,
      "goals_against": 24,
      "goal_diff": 28,
      "points": 57
    },
    // ... more teams
  ]
}

مثال لاستجابة JSON — جميع الدوريات

JSON — action=leagues_standings
{
  "status": "success",
  "count": 2,
  "data": [
    {
      "league_name": "الدوري الإنجليزي الممتاز",
      "league_name_ar": "الدوري الإنجليزي الممتاز",
      "league_name_en": "Premier League",
      "league_logo": "https://cdn.sportfeeds.io/.../premier-league.png",
      "standings_updated_at": "2026-02-22 08:00:00",
      "standings": [
        { "rank": 1, "team": "ليفربول", "played": 26, "points": 64, ... },
        { "rank": 2, "team": "أرسنال", "played": 26, "points": 57, ... },
        // ... 18 more teams
      ]
    },
    // ... more leagues
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$url = "https://hayachoout.space/api/get?action=leagues_standings";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: YOUR_API_KEY"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

foreach ($data['data'] as $league) {
    $name = $league['league_name_en'] ?? $league['league_name'];
    echo "🏆 {$name}\n";
    echo str_pad("#", 4) . str_pad("Team", 20)
       . str_pad("P", 5) . str_pad("W", 5)
       . str_pad("D", 5) . str_pad("L", 5)
       . "Pts\n";

    foreach ($league['standings'] as $row) {
        $team = $row['team_name'] ?? $row['team'];
        echo str_pad($row['rank'], 4)
           . str_pad(team, 20)
           . str_pad($row['played'], 5)
           . str_pad($row['won'], 5)
           . str_pad($row['drawn'], 5)
           . str_pad($row['lost'], 5)
           . $row['points'] . "\n";
    }
    echo "\n";
}

?>

قائمة الترتيب العام (Leagues Standings List)

GET ?action=leagues_standings
Tip
تعيد هذه النقطة مجموعة من جداول الترتيب للدوريات التي تتوفر لها بيانات كاملة.

مثال لاستجابة JSON

JSON — Leagues Standings List
{
  "status": "success",
  "count": 2,
  "data": [
    {
      "league_name": "الدوري الإنجليزي الممتاز",
      "league_logo": "https://example.com/epl.png",
      "standings": [
        { "rank": 1, "team": "ليفربول", "points": 64 },
        { "rank": 2, "team": "أرسنال", "points": 62 }
        // ...
      ]
    },
    {
      "league_name": "الدوري الإسباني",
      "league_logo": "https://example.com/laliga.png",
      "standings": [
        { "rank": 1, "team": "ريال مدريد", "points": 70 }
        // ...
      ]
    }
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$url = "https://hayachoout.space/api/get?action=leagues_standings";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: YOUR_API_KEY"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

foreach ($data['data'] as $league) {
    echo "🏆 {$league['league_name']}\n";
    foreach ($league['standings'] as $pos) {
        echo "  {$pos['rank']}. {$pos['team']} ({$pos['points']} pts)\n";
    }
    echo "-------------------\n";
}

?>

البث المباشر (Live Broadcast)

GET ?action=live_stream&id=1024
Tip
يوصى باستخدام حقل live_iframe لعرض البث المباشر بشكل متكامل داخل تطبيقك، حيث يوفر تجربة مشاهدة أفضل وتوافقية أعلى.

مثال لاستجابة JSON — حقل المباراة

JSON — match → live_url
{
  "status": "success",
  "data": {
    "id": 1024,
    "home_team": "الأهلي",
    "away_team": "الزمالك",
    // ... other match data ...
    "live_iframe": "<iframe src='https://player.example.com/embed/xyz' ...></iframe>"
  }
}

مثال لاستجابة JSON — نقطة وصول البث المباشر

JSON — ?action=live_stream
// ✅ Success Response
{
  "status": "success",
  "iframe": "<iframe src='https://player.example.com/embed/xyz' width='100%' height='500' allowfullscreen></iframe>",
  "source": "server-proxy"
}

// ❌ Error Response
{
  "status": "error",
  "message": "Live stream not found"
}

مثال لطلب PHP

PHP (cURL)
<?php

$matchId = 1024;
$url     = "https://hayachoout.space/api/get?action=live_stream&id={$matchId}";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: YOUR_API_KEY"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

if ($data['status'] === 'success') {
    // Embed the iframe directly in your HTML
    echo "<div class='live-player'>";
    echo $data['iframe'];
    echo "</div>";
    echo "Source: {$data['source']}\n";
} else {
    echo "❌ {$data['message']}\n";
}

?>

قائمة الدوريات (Leagues List)

GET ?action=leagues
Tip
جميع الدوريات المدعومة والنشطة، وتتضمن البيانات الأساسية والروابط.

مثال لاستجابة JSON

JSON Response
{
  "status": "success",
  "count": 3,
  "data": [
    {
      "id": 1,
      "name": "الدوري الإنجليزي الممتاز",
      "name_ar": "الدوري الإنجليزي الممتاز",
      "name_en": "Premier League",
      "logo_url": "https://cdn.sportfeeds.io/.../premier-league.png",
      "country": "England",
      "is_active": 1
    },
    {
      "id": 2,
      "name": "الدوري الإسباني",
      "name_ar": "الدوري الإسباني",
      "name_en": "La Liga",
      "logo_url": "https://cdn.sportfeeds.io/.../la-liga.png",
      "country": "Spain",
      "is_active": 1
    },
    // ... more leagues
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$url = "https://hayachoout.space/api/get?action=leagues";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: YOUR_API_KEY"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

echo "🏆 Leagues ({$data['count']}):\n\n";

foreach ($data['data'] as $league) {
    $name    = $league['name_en'] ?? $league['name'];
    $country = $league['country'] ?? 'N/A';
    $status  = $league['is_active'] ? '✅' : '❌';
    echo "  {$status} {$name} ({$country})\n";
}

?>

قائمة الفرق (Teams List)

GET ?action=teams
Tip
قائمة شاملة بجميع الفرق الرياضية المتاحة في النظام مع شعاراتها.

مثال لاستجابة JSON

JSON Response
{
  "status": "success",
  "count": 2,
  "data": [
    {
      "id": 1,
      "name": "الأهلي",
      "name_ar": "الأهلي",
      "name_en": "Al Ahly",
      "logo_url": "https://cdn.sportfeeds.io/.../al-ahly.png"
    },
    {
      "id": 2,
      "name": "الزمالك",
      "name_ar": "الزمالك",
      "name_en": "Zamalek",
      "logo_url": "https://cdn.sportfeeds.io/.../zamalek.png"
    }
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey = "YOUR_API_KEY";
$url    = "https://hayachoout.space/api/get?action=teams";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

if ($data['status'] === 'success') {
    echo "Found " . $data['count'] . " teams:\n\n";
    foreach ($data['data'] as $team) {
        $name = $team['name_en'] ?: $team['name'];
        echo "- " . $name . " (ID: " . $team['id'] . ")\n";
    }
}

?>

قائمة الدول (Countries List)

GET ?action=countries
Tip
قائمة الدول المتاحة والنشطة فقط والتي تتوفر لها دوريات أو فرق مدعومة.

مثال لاستجابة JSON

JSON Response
{
  "status": "success",
  "count": 2,
  "data": [
    {
      "id": 1,
      "name": "Egypt",
      "name_ar": "مصر",
      "name_en": "Egypt",
      "logo_url": "https://cdn.sportfeeds.io/.../egypt.png",
      "is_active": 1,
      "activated_at": "2026-02-21 10:00:00"
    },
    {
      "id": 2,
      "name": "Spain",
      "name_ar": "إسبانيا",
      "name_en": "Spain",
      "logo_url": "https://cdn.sportfeeds.io/.../spain.png",
      "is_active": 1,
      "activated_at": "2026-02-21 10:05:00"
    }
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey = "YOUR_API_KEY";
$url    = "https://hayachoout.space/api/get?action=countries";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

if ($data['status'] === 'success') {
    echo "🌍 Available Countries (" . $data['count'] . "):\n\n";
    foreach ($data['data'] as $country) {
        $name   = $country['name_ar'] ?: $country['name'];
        $status = $country['is_active'] ? "✅" : "❌";
        echo "{$status} " . $name . " (Code: " . $country['id'] . ")\n";
    }
}

?>

البحث عن اللاعبين (Players Search)

GET ?action=players&search=Messi
GET ?action=players&team_id=102
Tip
ابحث عن اللاعبين بالاسم أو قم بتصفيرة النتائج حسب معرف الفريق (Team ID).
المعامل (Parameter) النوع (Type) مطلوب (Required) الوصف (Description)
team_id Int لا تصفية اللاعبين حسب معرف الفريق
search String لا البحث عن لاعب بالاسم (يدعم العربية/الإنجليزية)

مثال لاستجابة JSON

JSON Response
{
  "status": "success",
  "count": 1,
  "total": 1,
  "data": [
    {
      "id": 501,
      "name": "Lionel Messi",
      "name_ar": "ليونيل ميسي",
      "name_en": "Lionel Messi",
      "position": "Forward",
      "number": "10",
      "image_url": "https://cdn.sportfeeds.io/.../messi.png",
      "team_id": 102,
      "team_name": "Inter Miami",
      "team_logo": "https://cdn.sportfeeds.io/.../inter-miami.png"
    }
  ]
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey = "YOUR_API_KEY";
$query  = urlencode("Messi");
$url    = "https://hayachoout.space/api/get?action=players&search={$query}";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["X-API-Key: {$apiKey}"],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);

if ($data['status'] === 'success') {
    echo "Found " . $data['count'] . " matching players:\n\n";
    foreach ($data['data'] as $player) {
        $name = $player['name_ar'] ?: $player['name'];
        echo "🏃 " . $name . " (#{$player['number']} | {$player['position']})\n";
        echo "🏟️ Team: {$player['team_name']}\n\n";
    }
}

?>

الأخبار (News)

GET ?action=news&limit=10
GET ?action=news_details&id=123
Tip
جلب آخر الأخبار الرياضية مع تفاصيل كاملة ودعم الصور والفيديوهات والترجمة.

مثال لاستجابة JSON — قائمة الأخبار

JSON Response
{
  "status": "success",
  "count": 1,
  "data": [
    {
      "id": 123,
      "title": "مانشستر سيتي يواجه ريال مدريد في قمة مرتقبة",
      "title_en": "Manchester City faces Real Madrid in anticipated clash",
      "image": "https://example.com/news/city-madrid.jpg",
      "date": "2026-02-22 10:00:00"
    }
  ]
}

مثال لاستجابة JSON — تفاصيل الخبر

JSON Response
{
  "status": "success",
  "data": {
    "id": 123,
    "title": "...",
    "body": "<p>تفاصيل الخبر بالكامل هنا...</p>",
    "body_en": "<p>Full article content in English...</p>",
    // ... other fields
  }
}

مثال لطلب PHP

PHP (cURL)
<?php

$apiKey = "YOUR_API_KEY";

// 1. Fetch Latest News
$listUrl = "https://hayachoout.space/api/get?action=news&limit=5";
$ch = curl_init($listUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: {$apiKey}"]);
$newsList = json_decode(curl_exec($ch), true);
curl_close($ch);

foreach ($newsList['data'] as $item) {
    echo "📰 " . $item['title'] . " (ID: " . $item['id'] . ")\n";
    
    // 2. Fetch specific details if needed
    // $detailUrl = "https://hayachoout.space/api/get?action=news_details&id=" . $item['id'];
}

?>