{"openapi":"3.0.3","info":{"title":"FairyAnime & Manga Customer API","version":"1.0.0","description":"Public Customer REST API for Manga (Dark-Manga), Anime (FairyAnime), Search, Categories/Genres, Chapter Images, and HLS Streams."},"servers":[{"url":"https://demoapp.lnw-manga.com","description":"Current API Server"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Customer API key configured in CUSTOMER_API_KEYS"},"BearerAuth":{"type":"http","scheme":"bearer","description":"Alternative: Authorization: Bearer <API_KEY>"}}},"paths":{"/api/v1/health":{"get":{"tags":["SYSTEM"],"operationId":"system-health","summary":"ตรวจสอบสถานะระบบ (Health & Capabilities)","description":"ใช้ตรวจสอบความพร้อมของ API Gateway, เช็กว่าระบบบังคับใช้ API Key หรือเปิดแบบ Public อยู่, ดูโควตา Rate Limit และ Endpoint ที่รองรับทั้งหมด","parameters":[],"responses":{"200":{"description":"เช็กสถานะ API, โหมดการยืนยันตัวตน, Rate Limit และจำนวนแคชปัจจุบัน","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/openapi.json":{"get":{"tags":["SYSTEM"],"operationId":"system-openapi","summary":"สเปก OpenAPI 3.0.3 JSON","description":"ส่งออก Schema มาตรฐาน OpenAPI 3.0.3 ของทุก Endpoint ในระบบ สามารถนำ URL นี้ไปวางใน Postman (Import -> Link) เพื่อสร้าง Collection ให้ลูกค้าใช้งานได้ทันที","parameters":[],"responses":{"200":{"description":"ดาวน์โหลดไฟล์ OpenAPI Specification สำหรับ Import เข้า Postman / Insomnia / Swagger","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga/home":{"get":{"tags":["MANGA"],"operationId":"manga-home","summary":"หน้าแรกมังงะ (Manga Home Showcase)","description":"รวมหมวดหมู่แนะนำทั้งหมดจากหน้าแรกใน Call เดียว เหมาะสำหรับหน้า Home ของเว็บหรือแอปมือถือของลูกค้า รูปภาพปกทั้งหมดถูกแปลงเป็น Absolute Proxy URL ที่โหลดข้ามโดเมนได้ทันที","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 หรือ true เพื่อข้ามแคชและดึงข้อมูลสดจากต้นทางทันที","schema":{"type":"string","default":"0","enum":["0","1"]},"example":"0"}],"responses":{"200":{"description":"ดึงมังงะยอดนิยม, อัปเดตล่าสุด, มังงะเกาหลี, มังงะจีน และอันดับมาแรง (Weekly/Monthly/All-Time)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga":{"get":{"tags":["MANGA"],"operationId":"manga-list","summary":"รายการมังงะทั้งหมด / เรียงลำดับ / กรองหมวดหมู่","description":"Endpoint อเนกประสงค์สำหรับหน้ารวมมังงะ รองรับการแบ่งหน้า (page), การเรียงลำดับ (order), การกรองแนวเรื่อง (genre), และการค้นหาด่วน (q)","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"page","in":"query","required":false,"description":"เลขหน้าที่ต้องการ (เริ่มที่ 1)","schema":{"type":"integer","default":1},"example":"1"},{"name":"order","in":"query","required":false,"description":"รูปแบบรายการ: latest / update (อัปเดตใหม่), popular (ยอดนิยม), korean (เกาหลี), chinese (จีน), all (สารบัญทั้งหมด)","schema":{"type":"string","default":"latest","enum":["latest","update","popular","korean","chinese","all"]},"example":"latest"},{"name":"genre","in":"query","required":false,"description":"Slug ของแนวเรื่อง (ถ้าส่งมา จะกรองตามหมวดหมู่นี้ทันที เช่น action, มังงะเกาหลี)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"คำค้นหาชื่อมังงะ (ถ้าส่งมา จะค้นหาและคืนผลลัพธ์ตรงนี้เลย)","schema":{"type":"string"}},{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 เพื่อบายพาสแคช","schema":{"type":"string","default":"0"}}],"responses":{"200":{"description":"ดึงรายการมังงะแบบแบ่งหน้า (Pagination) เลือกเรียงตามอัปเดตใหม่, ยอดนิยม, เกาหลี, จีน หรือค้นหาผ่านพารามิเตอร์เดียว","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga/search":{"get":{"tags":["MANGA"],"operationId":"manga-search","summary":"ค้นหามังงะ (Search Manga)","description":"เชื่อมต่อกับ Live Search ของ Dark-Manga โดยตรง รองรับทั้งภาษาไทยและอังกฤษ คืนรายการพร้อม slug, poster, genres, type, status และตอนล่าสุด","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"q","in":"query","required":true,"description":"คำค้นหาชื่อเรื่องมังงะ (จำเป็นต้องระบุ)","schema":{"type":"string"},"example":"solo"},{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 เพื่อบายพาสแคช","schema":{"type":"string","default":"0"}}],"responses":{"200":{"description":"ค้นหามังงะ มังฮวา มังงะจีนด้วยคำสำคัญทั้งภาษาไทยและภาษาอังกฤษ","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga/genres":{"get":{"tags":["MANGA"],"operationId":"manga-genres","summary":"รายการหมวดหมู่มังงะทั้งหมด (Manga Genres)","description":"ใช้สำหรับสร้างเมนู Filter หรือปุ่ม Tag หมวดหมู่มังงะบนหน้าเว็บหรือแอปของลูกค้า มีทั้งแนวภาษาไทย (เช่น พระเอกเทพ, เกิดใหม่, มังงะเกาหลี) และอังกฤษ","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[],"responses":{"200":{"description":"ดึงรายชื่อแนว/หมวดหมู่มังงะทั้ง 51 หมวดพร้อม slug และลิงก์ API","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga/genres/{slug}":{"get":{"tags":["MANGA"],"operationId":"manga-by-genre","summary":"ดึงมังงะตามหมวดหมู่ (Manga by Genre)","description":"ส่ง slug ของหมวดหมู่ (รองรับทั้ง slug ภาษาไทยที่ URL-encoded และภาษาอังกฤษ เช่น action, มังงะเกาหลี, พระเอกเทพ) เพื่อดึงมังงะในแนวนั้น ๆ","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Slug ของหมวดหมู่มังงะ (เช่น action, มังงะเกาหลี, พระเอกเทพ)","schema":{"type":"string"},"example":"action"},{"name":"page","in":"query","required":false,"description":"เลขหน้าที่ต้องการ","schema":{"type":"integer","default":1},"example":"1"},{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 เพื่อบายพาสแคช","schema":{"type":"string","default":"0"}}],"responses":{"200":{"description":"ดึงรายการมังงะในหมวดหมู่ที่ระบุแบบแบ่งหน้า","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga/{slug}":{"get":{"tags":["MANGA"],"operationId":"manga-detail","summary":"รายละเอียดมังงะ & รายชื่อตอนทั้งหมด (Manga Detail)","description":"คืนข้อมูลครบชุดสำหรับหน้าแสดงรายละเอียดมังงะ รวมถึง firstChapter, latestChapter และ array chapters[] ที่มี chapterSlug สำหรับนำไปยิง Endpoint อ่านตอนต่อทันที","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Slug ของเรื่องมังงะ","schema":{"type":"string"},"example":"30y-prologue"},{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 เพื่อบายพาสแคช","schema":{"type":"string","default":"0"}}],"responses":{"200":{"description":"ดึงข้อมูลเรื่องย่อ, ผู้แต่ง, ผู้วาด, เรตติ้ง, แนวเรื่อง และรายการตอนทั้งหมด","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/manga/chapters/{chapterSlug}":{"get":{"tags":["MANGA"],"operationId":"manga-chapter","summary":"ดึงภาพหน้ากระดาษสำหรับอ่านมังงะ (Manga Chapter Images)","description":"คืนค่า images[] เป็น Absolute URL ที่ผ่าน Proxy แล้วทั้งหมด ลูกค้าสามารถนำ URL ใน array ไปใส่ในแท็ก <img> หรือ Image Viewer ได้ทันทีโดยไม่ติด Hotlink Protection","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"chapterSlug","in":"path","required":true,"description":"chapterSlug ที่ได้จากฟิลด์ chapters[] ใน Manga Detail","schema":{"type":"string"},"example":"30y-prologue-ตอนที่-21"},{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 เพื่อบายพาสแคช","schema":{"type":"string","default":"0"}}],"responses":{"200":{"description":"ดึง URL ภาพทุกหน้าในตอนนั้นเรียงตามลำดับ พร้อมตอนก่อนหน้า/ตอนถัดไป","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime/home":{"get":{"tags":["ANIME"],"operationId":"anime-home","summary":"หน้าแรกอนิเมะ (Anime Home Showcase)","description":"ดึงข้อมูลหน้าแรกของระบบอนิเมะพร้อมกัน 4 หมวดหลัก (latest, dub, sub, topRated) และรายชื่อหมวดหมู่หลัก","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"fresh","in":"query","required":false,"description":"ส่ง 1 เพื่อบายพาสแคช","schema":{"type":"string","default":"0"}}],"responses":{"200":{"description":"ดึงอนิเมะอัปเดตล่าสุด, พากย์ไทย, ซับไทย และคะแนนรีวิวสูงสุดใน Call เดียว","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime":{"get":{"tags":["ANIME"],"operationId":"anime-list","summary":"รายการอนิเมะทั้งหมด / หมวดหมู่ / แนวเรื่อง","description":"Endpoint หลักสำหรับดึงรายการอนิเมะทุกหมวดหมู่ รองรับทั้ง parameter `category`, `genre`, และ `q` พร้อม Pagination","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"page","in":"query","required":false,"description":"เลขหน้าที่ต้องการ","schema":{"type":"integer","default":1},"example":"1"},{"name":"category","in":"query","required":false,"description":"หมวดหมู่: home (ล่าสุด), พากย์ไทย / dub, ซับไทย / sub, scoretop (คะแนนสูงสุด)","schema":{"type":"string","default":"home","enum":["home","dub","sub","พากย์ไทย","ซับไทย","scoretop"]},"example":"home"},{"name":"genre","in":"query","required":false,"description":"Slug แนวนิเมะ (ดูรายการจาก /api/v1/anime/categories)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"คำค้นหาชื่ออนิเมะ","schema":{"type":"string"}}],"responses":{"200":{"description":"ดึงรายการอนิเมะแบบแบ่งหน้า กรองตาม category (พากย์ไทย/ซับไทย/scoretop), genre หรือค้นหาผ่าน q","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime/search":{"get":{"tags":["ANIME"],"operationId":"anime-search","summary":"ค้นหาอนิเมะ (Search Anime)","description":"ค้นหาอนิเมะจากฐานข้อมูล FairyAnime พร้อมลิงก์โปสเตอร์ที่ Proxy แล้ว","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"q","in":"query","required":true,"description":"คำค้นหาชื่ออนิเมะ","schema":{"type":"string"},"example":"one piece"}],"responses":{"200":{"description":"ค้นหาอนิเมะจากระบบด้วยคำสำคัญ","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime/categories":{"get":{"tags":["ANIME"],"operationId":"anime-categories","summary":"หมวดหมู่และ 56 แนวอนิเมะ (Categories & Genres)","description":"คืนค่า categories (หน้าแรก, พากย์ไทย, ซับไทย, คะแนนสูงสุด) และ genres ทั้ง 56 แนวพร้อม endpoint สำหรับดึงรายการ","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[],"responses":{"200":{"description":"ดึงรายการหมวดหมู่หลัก และ 56 แนวอนิเมะทั้งหมดในระบบ","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime/genres/{slug}":{"get":{"tags":["ANIME"],"operationId":"anime-by-genre","summary":"ดึงอนิเมะตามแนวเรื่อง (Anime by Genre)","description":"ส่ง slug ของแนวอนิเมะ (เช่น action, isekai, romance, fantasy) เพื่อดึงรายการอนิเมะในแนวนั้น","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Slug ของแนวอนิเมะ (เช่น action, isekai, fantasy)","schema":{"type":"string"},"example":"action"},{"name":"page","in":"query","required":false,"description":"เลขหน้าที่ต้องการ","schema":{"type":"integer","default":1},"example":"1"}],"responses":{"200":{"description":"ดึงรายการอนิเมะตาม slug แนวเรื่องแบบแบ่งหน้า","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime/{slug}":{"get":{"tags":["ANIME"],"operationId":"anime-detail","summary":"รายละเอียดอนิเมะ & รายการตอน (Anime Detail)","description":"ใช้ slug ของอนิเมะเพื่อดึงรายละเอียดทั้งหมดและรายการ episodes[] ที่มี epId สำหรับนำไปดึงลิงก์สตรีมวิดีโอ HLS","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Slug ของเรื่องอนิเมะ","schema":{"type":"string"},"example":"one-piece"}],"responses":{"200":{"description":"ดึงเรื่องย่อ, เรตติ้ง, ยอดเข้าชม, สถานะ, แนวเรื่อง และรายการ epId ทุกตอน","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}},"/api/v1/anime/stream/{epId}":{"get":{"tags":["ANIME"],"operationId":"anime-stream","summary":"ดึงลิงก์สตรีมวิดีโอ HLS M3U8 (Anime Stream Extractor)","description":"ส่ง epId เพื่อรับ masterPlaylistUrl และ qualities[] ที่ผ่าน Stealth M3U8 Proxy ของเซิร์ฟเวอร์แล้ว นำไปเปิดใน hls.js, Video.js, ExoPlayer หรือ AVPlayer ได้ทันทีโดยไม่ติด CORS/Referer","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{}],"parameters":[{"name":"epId","in":"path","required":true,"description":"รหัส epId ของตอน (ได้จาก episodes[].epId ใน Anime Detail)","schema":{"type":"string"},"example":"HC9Bz64p"}],"responses":{"200":{"description":"แยกลิงก์ Master M3U8 ที่ผ่าน Proxy โดเมนหลักแล้ว พร้อมรายการความละเอียด (1080p/720p)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"meta":{"type":"object"},"data":{"type":"object"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Missing API Key (when auth enabled)"},"403":{"description":"Invalid API Key"},"404":{"description":"Resource Not Found"},"429":{"description":"Rate Limit Exceeded"}}}}}}