API Documentation

Dokumentasi REST API untuk RumahPlayer. Gunakan API ini untuk mengakses data anime, episode, dan lainnya.

📖 Pendahuluan

Selamat datang di API RumahPlayer. API ini memungkinkan Anda untuk mengakses data anime, episode, dan informasi lainnya yang tersedia di website RumahPlayer. API ini dirancang dengan prinsip REST dan mengembalikan data dalam format JSON.

Catatan: API ini masih dalam tahap pengembangan. Semua endpoint dapat berubah tanpa pemberitahuan. Gunakan dengan bijak.

🔐 Autentikasi

Saat ini, API RumahPlayer tidak memerlukan autentikasi untuk endpoint publik (GET requests). Namun untuk endpoint yang memerlukan perubahan data (POST, PUT, DELETE), diperlukan API Key.

API Key

Untuk mendapatkan API Key, hubungi administrator. Setelah mendapatkan key, sertakan dalam header request:

X-API-Key: your-api-key-here

🔗 Base URL

Semua endpoint API berada di bawah base URL berikut:

https://rumahplayer.online/api/

Contoh lengkap: https://rumahplayer.online/api/anime

🎬 Anime

GET /api/anime
Mengambil daftar semua anime dengan pagination.

Parameters

Parameter Tipe Keterangan
page (opsional) integer Nomor halaman (default: 1)
limit (opsional) integer Jumlah item per halaman (default: 20, max: 50)
type (opsional) string Filter tipe: 'series' atau 'movie'
status (opsional) string Filter status: 'ongoing' atau 'completed'

Example Request

GET https://rumahplayer.online/api/anime?page=1&limit=10&type=series

Example Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Sousou no Frieren",
      "synopsis": "Setelah kematian pahlawan...",
      "poster": "frieren.jpg",
      "genre": "Adventure, Drama, Fantasy",
      "year_release": 2023,
      "status": "ongoing",
      "type": "series",
      "created_at": "2026-01-20 10:30:00"
    }
  ],
  "total": 50,
  "page": 1,
  "total_pages": 5
}
GET /api/anime/{id}
Mengambil detail anime berdasarkan ID, termasuk daftar episode.

Parameters

Parameter Tipe Keterangan
id (wajib) integer ID anime yang ingin dilihat

Example Request

GET https://rumahplayer.online/api/anime/1

Example Response

{
  "success": true,
  "data": {
    "anime": {
      "id": 1,
      "title": "Sousou no Frieren",
      "synopsis": "...",
      "poster": "frieren.jpg",
      "genre": "Adventure, Drama, Fantasy",
      "year_release": 2023,
      "status": "ongoing",
      "type": "series",
      "episode_count": 28
    },
    "episodes": [
      {
        "id": 101,
        "title": "Perjalanan Panjang",
        "episode_number": 1,
        "views": 15000,
        "created_at": "2026-01-20"
      }
    ]
  }
}

🎥 Episode

GET /api/episodes/recent
Mengambil episode terbaru.

Parameters

Parameter Tipe Keterangan
limit (opsional) integer Jumlah episode (default: 10, max: 30)

Example Request

GET https://rumahplayer.online/api/episodes/recent?limit=5

Example Response

{
  "success": true,
  "data": [
    {
      "id": 150,
      "title": "Episode 10: Pertemuan Baru",
      "episode_number": 10,
      "anime_id": 1,
      "anime_title": "Sousou no Frieren",
      "views": 1200,
      "created_at": "2026-03-13 01:00:00"
    }
  ]
}
GET /api/episodes/{id}
Mengambil detail episode berdasarkan ID.

Parameters

Parameter Tipe Keterangan
id (wajib) integer ID episode yang ingin dilihat

Example Request

GET https://rumahplayer.online/api/episodes/150

🏷️ Genre

GET /api/genres
Mengambil daftar semua genre yang tersedia.

Example Request

GET https://rumahplayer.online/api/genres

Example Response

{
  "success": true,
  "data": ["Action", "Adventure", "Comedy", "Drama", "Fantasy", "Slice of Life", "Supernatural"],
  "total": 7
}

⚠️ Error Handling

API mengembalikan kode status HTTP standar untuk menunjukkan keberhasilan atau kegagalan request.

Kode Deskripsi Contoh Response
200 OK - Request berhasil { "success": true, "data": [...] }
400 Bad Request - Parameter tidak valid { "success": false, "error": "Parameter 'q' wajib diisi" }
401 Unauthorized - API Key tidak valid { "success": false, "error": "API Key tidak valid" }
404 Not Found - Data tidak ditemukan { "success": false, "error": "Anime tidak ditemukan" }
500 Internal Server Error { "success": false, "error": "Terjadi kesalahan server" }

⏱️ Rate Limit

Untuk menjaga stabilitas server, API menerapkan rate limiting sebagai berikut:

  • 60 request per menit untuk IP yang sama
  • 1000 request per hari untuk IP yang sama
  • 120 request per menit dengan API Key

Jika melebihi limit, akan menerima response dengan kode 429 Too Many Requests.

🤖 Telegram Bot API

RumahPlayer menyediakan bot Telegram untuk mendapatkan notifikasi episode terbaru secara otomatis. Berikut adalah endpoint yang tersedia untuk mengintegrasikan bot Telegram dengan aplikasi Anda.

Bot Telegram: @rumahplayer_bot - Dapatkan notifikasi episode terbaru langsung di Telegram Anda.
POST /api/telegram/send
Mengirim notifikasi ke channel Telegram (khusus admin).

Headers

Header Keterangan
X-API-Key (wajib) API Key admin untuk autentikasi

Request Body

Parameter Tipe Keterangan
type (wajib) string Tipe notifikasi: 'episode', 'movie', 'batch', 'test'
post_id (opsional) integer ID post (untuk tipe 'episode' atau 'movie')
custom_message (opsional) string Pesan kustom (untuk tipe 'test')

Example Request

POST https://rumahplayer.online/api/telegram/send
X-API-Key: your-admin-api-key
Content-Type: application/json

{
    "type": "test",
    "custom_message": "Test notifikasi dari API"
}

Example Response

{
  "success": true,
  "message": "Notifikasi berhasil dikirim ke Telegram",
  "data": {
    "chat_id": "@RumahPlayerUpdates",
    "message_id": 1234
  }
}
GET /api/telegram/status
Mendapatkan status bot Telegram (khusus admin).

Headers

Header Keterangan
X-API-Key (wajib) API Key admin untuk autentikasi

Example Request

GET https://rumahplayer.online/api/telegram/status
X-API-Key: your-admin-api-key

Example Response

{
  "success": true,
  "data": {
    "bot_name": "@rumahplayer_bot",
    "channel": "@RumahPlayerUpdates",
    "is_active": true,
    "stats": {
      "total_notifications": 1250,
      "today_notifications": 5,
      "last_notification": "2026-03-13 01:00:00"
    }
  }
}
PUT /api/telegram/settings
Mengupdate pengaturan bot Telegram (khusus admin).

Headers

Header Keterangan
X-API-Key (wajib) API Key admin untuk autentikasi

Request Body

Parameter Tipe Keterangan
bot_token (opsional) string Token bot Telegram baru
channel_id (opsional) string ID channel baru
notification_enabled (opsional) boolean Aktifkan/nonaktifkan notifikasi
notify_new_episode (opsional) boolean Notifikasi episode baru
notify_new_movie (opsional) boolean Notifikasi movie baru

Example Request

PUT https://rumahplayer.online/api/telegram/settings
X-API-Key: your-admin-api-key
Content-Type: application/json

{
    "notification_enabled": true,
    "notify_new_episode": true,
    "notify_new_movie": true
}

Example Response

{
  "success": true,
  "message": "Pengaturan Telegram berhasil diupdate",
  "data": {
    "notification_enabled": true,
    "notify_new_episode": true,
    "notify_new_movie": true
  }
}

📱 Format Notifikasi

Bot Telegram mengirimkan notifikasi dalam format berikut:

Episode Series

🎬 Sousou no Frieren 2nd Season
─────────────────

📺 Episode 10
📝 Episode 10: Pertemuan Baru

📅 Rilis: 13 Maret 2026
🏷️ Genre: Adventure, Drama, Fantasy

🔗 https://rumahplayer.online/post.php?id=123
👉 Tonton Sekarang di RumahPlayer

#SousounoFrieren2ndSeason #EpisodeBaru

Movie

🎬 Jujutsu Kaisen 0
─────────────────

🍿 MOVIE
📝 Jujutsu Kaisen 0: The Movie

📅 Rilis: 13 Maret 2026
🏷️ Genre: Action, Supernatural

🔗 https://rumahplayer.online/post.php?id=124
👉 Tonton Movie di RumahPlayer

#JujutsuKaisen0 #AnimeMovie

Batch Notification

🎬 Episode Baru Hari Ini
─────────────────

📺 Sousou no Frieren
   Episode 10: Pertemuan Baru
   🔗 https://rumahplayer.online/post.php?id=123

📺 Jujutsu Kaisen
   Episode 12: Pertarungan Final
   🔗 https://rumahplayer.online/post.php?id=124

#RumahPlayer #UpdateEpisode

📲 Cara Subscribe ke Bot Telegram

  1. Buka aplikasi Telegram
  2. Cari @rumahplayer_bot di kolom pencarian
  3. Klik Start atau kirim perintah /start
  4. Bot akan meminta Anda memilih channel atau grup untuk menerima notifikasi
  5. Selesai! Anda akan menerima notifikasi setiap ada episode baru
Perintah yang tersedia:
  • /start - Memulai bot
  • /help - Bantuan
  • /recent - Episode terbaru
  • /subscribe - Subscribe ke notifikasi
  • /unsubscribe - Berhenti subscribe
  • /status - Status subscription

💻 Contoh Kode

cURL

curl -X GET "https://rumahplayer.online/api/anime?page=1" \
  -H "Accept: application/json"

JavaScript (Fetch)

fetch('https://rumahplayer.online/api/anime?page=1')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

PHP

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://rumahplayer.online/api/anime?page=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json'
]);

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

$data = json_decode($response, true);
print_r($data);
?>

Python

import requests

url = "https://rumahplayer.online/api/anime?page=1"
headers = {"Accept": "application/json"}

response = requests.get(url, headers=headers)
data = response.json()
print(data)