Anizil Anizil
Home Schedule Forum Cards Me

📚 API Documentation

Complete REST API reference, database schema, and platform guide for Anizil.

Quick Start

🔧

Tech Stack

PHP 8.x + MySQL + Tailwind CSS + Vanilla JS. No frameworks, no Composer.

🗄️

Database

MySQL / MariaDB 10.4+. 40+ tables. All data in MySQL — no JSON files.

🌐

Frontend

HTML5 + Tailwind CSS (CDN) + Lucide Icons. Dark theme, responsive.

🚀

Features

Streaming, gamification, cards, premium, forum, PWA, REST API.

Installation

1

Upload Files

Upload all files to your web root (e.g., /public_html/).

2

Create Database

Run install/full_install.sql in phpMyAdmin or MySQL CLI. Creates database, 40+ tables, admin user.

mysql -u root -p < install/full_install.sql
3

Configure Connection

Edit config/db.php with your database credentials.

define('DB_HOST', '127.0.0.1'); define('DB_NAME', 'your_database'); define('DB_USER', 'your_user'); define('DB_PASS', 'your_password');
4

Admin Login

Go to /admin/ — Email: animelife7@gmail.com — Password: Sadhin12@

⚠️ Delete install/ directory after setup for security.

REST API

Base URL: https://anizil.proo.one/api — All responses are JSON. No auth required for public endpoints.

ℹ️ Example: https://anizil.proo.one/api/anime returns all published anime as JSON.

Response Format

// Success { "success": true, "data": { ... } } // Error { "success": false, "error": "Error message" }

API Endpoints

🎬 Anime

GET/apiAPI info + endpoint list
GET/api/animeAll published anime
GET/api/anime/{id}Anime by ID
GET/api/anime/{slug}Anime by slug
GET/api/anime/{slug}/episodesEpisodes for anime
GET/api/search?q={query}Search anime
GET/api/trending?limit=NTrending anime
GET/api/latest?limit=NLatest anime
GET/api/recent?limit=NRecently updated
GET/api/randomRandom anime
GET/api/genre/{genre}Anime by genre
GET/api/airingCurrently airing
GET/api/calendarWeekly schedule

📺 Episodes

GET/api/episode/{id}Episode with sources
GET/api/stream/{code}Episode by stream code

🔗 AniList Integration

GET/api/anilist/airing-todayAiring today (AniList)
GET/api/anilist/upcoming?limit=NUpcoming episodes
GET/api/anilist/scheduleWeekly schedule

👤 Users

GET/api/user/{id}User profile
GET/api/user/{id}/watchlistUser watchlist
GET/api/user/{id}/historyWatch history
POST/api/loginLogin (email + password)
POST/api/registerRegister new account

💬 Community

GET/api/forumAll forum posts
GET/api/forum/{id}Single forum post
GET/api/statsSite statistics

📁 Sub-Endpoints (Separate Files)

FileMethodDescription
api/watchlist.phpGET POSTUser watchlist CRUD
api/watch_later.phpGET POSTWatch later list
api/watch_party.phpGET POSTWatch party rooms
api/timestamp.phpGET POSTResume playback position
api/report.phpPOSTReport content
api/push.phpPOSTSubscribe to push
api/search.phpGETAdvanced search
api/badge_color.phpPOSTSave pro badge color

Implementation Guide

How to use the Anizil API to build your own anime streaming website.

Step 1: Get Anime List

// Fetch all published anime GET https://anizil.proo.one/api/anime // Response: { "success": true, "data": [ { "id": 1, "title": "Attack on Titan", "slug": "attack-on-titan", "poster_url": "https://...", "genre": ["Action", "Fantasy"], "airing_status": "Finished Airing", "is_premium": false, "free_episodes": 1 } ] }

Step 2: Get Anime Info + Episodes

// Get anime details by slug GET https://anizil.proo.one/api/anime/{slug} // Get episodes for this anime GET https://anizil.proo.one/api/anime/{slug}/episodes // Response: { "success": true, "data": [ { "id": 101, "anime_id": 1, "episode_number": 1, "title": "Episode 1", "stream_code": "AK1234a1b2c3d4e5f6", "sources": [], "view_count": 1520 } ] }

Step 3: Get Stream URL (Video Sources)

// Get episode by stream code — this returns video URLs GET https://anizil.proo.one/api/stream/{stream_code} // Example: GET https://anizil.proo.one/api/stream/AK1234a1b2c3d4e5f6 // Response: { "success": true, "data": { "id": 101, "anime_id": 1, "episode_number": 1, "title": "Episode 1", "stream_code": "AK1234a1b2c3d4e5f6", "sources": [ { "language_name": "SUB", "server_name": "Main", "video_url": "https://...", "source_type": "embed" }, { "language_name": "DUB", "server_name": "Main", "video_url": "https://...", "source_type": "embed" } ] } }

Step 4: Build Your Player Page

// HTML example for your player page <div class="player"> <iframe src="<?php echo $source['video_url']; ?>" width="100%" height="500" frameborder="0" allowfullscreen ></iframe> </div> <div class="episode-list"> <<!-- Loop through episodes --> <?php foreach ($episodes as $ep): ?> <a href="/watch/<?php echo $ep['stream_code']; ?>"> Episode <?php echo $ep['episode_number']; ?> </a> <?php endforeach; ?> </div>

Stream Code Format

ℹ️ Each episode has a unique stream_code. Format: AK{id}{8-char-md5}. Use this code in /api/stream/{code} to get video sources.
🔍

Search Anime

GET /api/search?q=naruto — Search by title. Returns matching anime list.

📅

Schedule

GET /api/calendar — Weekly broadcast schedule. GET /api/airing — Currently airing.

🎲

Random

GET /api/random — Get a random anime. Great for "Surprise Me" feature.

📈

Trending

GET /api/trending?limit=10 — Top trending anime. GET /api/latest — Recently added.

Full Integration Flow

1

Load Anime List

Call GET /api/anime to get all anime. Cache the response for 5 minutes.

2

Show Anime Info Page

When user clicks anime, call GET /api/anime/{slug} for details + GET /api/anime/{slug}/episodes for episode list.

3

Play Episode

When user clicks episode, use stream_code to call GET /api/stream/{code}. Get video_url from sources and embed in iframe.

4

Handle Premium

Check is_premium flag. If true, check free_episodes. Episodes beyond free_episodes count require premium access.

Database Schema

40+ tables. MySQL only. Run install/full_install.sql to create all.

Core Tables

TableDescription
usersUser accounts, roles, XP, level, premium status, badge color
animeAnime titles, metadata, premium flag, free episodes count
episodesEpisode data, stream codes, view count
episode_sourcesVideo sources per episode (SUB/DUB/RAW)

User Features

TableDescription
watch_historyViewing history
watchlistsUser watchlists
watch_laterWatch later queue
episode_timestampsResume playback positions
user_cardsCollected cards
user_themesProfile themes

Card System

TableDescription
cardsCard definitions (rarity, drop rate)
characters_dbCharacter database

Community

TableDescription
commentsEpisode comments
forum_postsForum threads
reportsContent reports
activity_feedSocial activity feed
followsUser follow relationships

Gamification

TableDescription
achievementsUser achievements
badge_shopBadge marketplace
redeem_codesGift codes (XP, Premium, Badges)

Site Management

TableDescription
settingsKey-value site settings
analyticsDaily view metrics
audit_logAdmin action log
notificationsUser notifications
password_resetsPassword reset tokens
backupsDatabase backup records

Payments & Premium

TableDescription
donationsbKash/Nagad donations
episode_ratingsEpisode ratings
user_reviewsAnime reviews

Key Features

📺

Streaming

Multi-source video player (Sub/Dub/RAW), server switching, resume playback, stream codes.

🎮

Gamification

XP & levels, collectible cards (30% drop rate), badge shop, achievements, redeem codes.

💬

Social

User profiles with themes, watchlist sharing, forum, activity feed, follow system.

👑

Premium

Premium anime gating, XP-based purchase, premium gifting, custom badge colors.

📥

Content Import

Anikoto API, Anizen API, AniList GraphQL, Jikan API for character images.

📱

PWA

Service worker for offline, app manifest for install, push notifications.

Stream Code Format

// Each episode has a unique stream code // Format: AK{id}{8-char-md5} // Example: AK1234a1b2c3d4e5f6

Deployment

Production Domains

https://anizil.proo.one https://anizil.proo.one

Post-Install Checklist

1

Configure DB

Edit config/db.php with production credentials.

2

Set Base URL

Set base_url in Admin → Site Settings to match your domain.

3

Enable HTTPS

Configure SSL in .htaccess or server config.

4

Delete Install

Remove install/ directory after setup.

5

Configure SMTP

Set up email in Admin → Email Config for notifications.

External APIs

APIBase URLAuth
Anikotohttps://anikotoapi.siteNone
Anizenhttps://cdn.anizen.trNone
AniListhttps://graphql.anilist.coNone
Jikanhttps://api.jikan.moe/v4None (1 req/sec)

.htaccess

RewriteEngine On RewriteBase / # HTTPS redirect RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # API routing RewriteRule ^api/?$ api/index.php [L,QSA] RewriteRule ^api/(.+)$ api/index.php [L,QSA] # Admin routing RewriteRule ^admin/?$ admin/index.php [L,QSA] # Friendly URLs RewriteRule ^anime/(.+)$ anime.php?slug=$1 [L,QSA] RewriteRule ^watch/(.+)$ watch.php?stream=$1 [L,QSA]