{"openapi":"3.1.0","info":{"title":"Truyện Nhà Na Public API","version":"1.0.0","description":"API công khai chỉ đọc để tra cứu thư viện truyện audio tiếng Việt của Truyện Nhà Na. Không cần xác thực. Các endpoint chỉ trả về truyện đã phát hành.","contact":{"name":"Truyện Nhà Na","url":"https://www.truyennhana.io.vn/contact"},"license":{"name":"Xem điều khoản sử dụng","url":"https://www.truyennhana.io.vn/terms"}},"servers":[{"url":"https://www.truyennhana.io.vn","description":"Production"}],"tags":[{"name":"Public catalog","description":"Dữ liệu công khai về truyện, chương và danh mục."}],"paths":{"/api/public/v1":{"get":{"tags":["Public catalog"],"operationId":"getPublicApiIndex","summary":"Danh sách endpoint công khai","description":"Trả về thông tin dịch vụ, các endpoint và liên kết tài liệu máy đọc.","responses":{"200":{"description":"Thông tin API và endpoint khả dụng.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiIndex"}}}}}}},"/api/public/v1/stories":{"get":{"tags":["Public catalog"],"operationId":"listPublicStories","summary":"Liệt kê truyện đã phát hành","description":"Hỗ trợ phân trang bằng offset hoặc cursor. Giới hạn tối đa 30 truyện mỗi trang.","parameters":[{"name":"limit","in":"query","description":"Số truyện mỗi trang.","required":false,"schema":{"type":"integer","minimum":1,"maximum":30,"default":30}},{"name":"offset","in":"query","description":"Vị trí bắt đầu. Không dùng cùng lúc với cursor.","required":false,"schema":{"type":"integer","minimum":0}},{"name":"cursor","in":"query","description":"Cursor của trang tiếp theo từ trường next_cursor.","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","description":"Tên danh mục cần lọc.","required":false,"schema":{"type":"string"}},{"name":"completion_status","in":"query","description":"Trạng thái hoàn thành của truyện.","required":false,"schema":{"type":"string","enum":["ongoing","completed","upcoming"]}},{"name":"search","in":"query","description":"Từ khóa tìm kiếm theo tên truyện.","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"Danh sách truyện đã phát hành.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoryPage"}}}},"400":{"description":"Tham số truy vấn không hợp lệ.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Catalog tạm thời không khả dụng.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/v1/stories/{story_id}":{"get":{"tags":["Public catalog"],"operationId":"getPublicStory","summary":"Lấy chi tiết một truyện","parameters":[{"name":"story_id","in":"path","required":true,"description":"Mã UUID của truyện.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Chi tiết truyện đã phát hành.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Story"}}}},"404":{"description":"Không tìm thấy truyện.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Catalog tạm thời không khả dụng.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/v1/categories":{"get":{"tags":["Public catalog"],"operationId":"listPublicCategories","summary":"Liệt kê danh mục truyện","responses":{"200":{"description":"Danh sách danh mục truyện.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryList"}}}},"503":{"description":"Catalog tạm thời không khả dụng.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"PublicApiIndex":{"type":"object","required":["service","api_version","endpoints","links"],"properties":{"service":{"type":"string","const":"Truyện Nhà Na"},"api_version":{"type":"string","const":"1"},"description":{"type":"string"},"endpoints":{"type":"array","items":{"type":"object","required":["method","path","description"],"properties":{"method":{"type":"string","const":"GET"},"path":{"type":"string"},"description":{"type":"string"}}}},"links":{"$ref":"#/components/schemas/Links"}}},"Story":{"type":"object","required":["story_id","title","slug","author_name"],"properties":{"story_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"slug":{"type":"string"},"author_name":{"type":"string"},"description":{"type":["string","null"]},"cover_url":{"type":["string","null"],"format":"uri"},"status":{"type":"string"},"completion_status":{"type":"string"},"view_count":{"type":"integer","minimum":0},"chapter_count":{"type":"integer","minimum":0},"episode_count":{"type":"integer","minimum":0},"category":{"type":["string","null"]},"age_rating_id":{"type":["string","null"]},"updated_at":{"type":["string","null"],"format":"date-time"}}},"StoryPage":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["items","total","has_more","next_cursor"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Story"}},"total":{"type":"integer","minimum":0},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"$ref":"#/components/schemas/Links"}}},"CategoryList":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"string"}},"links":{"$ref":"#/components/schemas/Links"}}},"Links":{"type":"object","properties":{"documentation":{"type":"string","format":"uri"},"openapi":{"type":"string","format":"uri"},"llms":{"type":"string","format":"uri"},"catalog":{"type":"string","format":"uri"},"sitemap":{"type":"string","format":"uri"},"self":{"type":"string","format":"uri"},"next":{"type":["string","null"]}}},"Error":{"type":"object","required":["success","error","links"],"properties":{"success":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"links":{"$ref":"#/components/schemas/Links"}}}}}}