Chuyển tới nội dung chính

Metadata API

Lấy metadata chi tiết cho anime và manga, bao gồm tiêu đề, mô tả, hình ảnh, thể loại, studio, quan hệ, và nhiều hơn nữa.

Endpoints

Lấy Metadata Media

GET /api/v1/metadata

Lấy Metadata hàng loạt

GET /api/v1/metadata/batch

Lấy Metadata Media

Trả về metadata toàn diện cho một media item.

Tham số

Tham sốKiểuBắt buộcMô tả
idstring/integerMedia ID hoặc AniList ID

Tham số id chấp nhận:

  • Media ID (ID database nội bộ)
  • AniList ID
  • AniList external key (chuỗi)

Ví dụ Request

GET /api/v1/metadata?id=16498
GET /api/v1/metadata?id=16498

Response thành công (200 OK)

{
"success": true,
"result": {
"id": 16498,
"mediaType": "ANIME",
"format": "TV",
"status": "FINISHED",
"source": "MANGA",
"countryOfOrigin": "JP",
"startDate": "2013-04-07",
"endDate": "2013-09-29",
"season": "SPRING",
"seasonYear": 2013,
"totalUnits": 25,
"unitDurationMin": 24,
"hashtag": "#shingeki",
"createdAt": 1640995200000,
"updatedAt": 1640995200000,
"titles": {
"en": "Attack on Titan",
"ja": "進撃の巨人",
"vi": "Cuộc tấn công của Titan"
},
"descriptions": {
"en": "Several hundred years ago, humans were nearly exterminated by titans...",
"vi": "Vài trăm năm trước, loài người gần như bị tuyệt chủng bởi các Titan..."
},
"images": {
"coverXl": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx16498-C7FPm3m59CyP.jpg",
"coverLg": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx16498-C7FPm3m59CyP.jpg",
"coverMd": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/small/bx16498-C7FPm3m59CyP.jpg",
"coverColor": "#E4E4E4",
"bannerUrl": "https://s4.anilist.co/file/anilistcdn/media/anime/banner/16498-8YHjVabJfCr2.jpg"
},
"trailer": {
"site": "youtube",
"trailerId": "M_UfrS3q6yI",
"thumbnail": "https://img.youtube.com/vi/M_UfrS3q6yI/maxresdefault.jpg"
},
"relations": [
{
"relatedMediaId": 16499,
"relationType": "SEQUEL"
}
],
"genres": [
{
"id": 1,
"name": "Action"
},
{
"id": 2,
"name": "Drama"
}
],
"studios": [
{
"id": 1,
"name": "Wit Studio",
"isAnimationStudio": true,
"isMain": true
}
],
"tags": [
{
"id": 1,
"name": "Gore",
"description": "Contains graphic violence and gore"
}
],
"externalIds": [
{
"source": "ANILIST",
"externalKey": null,
"externalInt": 16498
},
{
"source": "MYANIMELIST",
"externalKey": null,
"externalInt": 16498
}
],
"units": [
{
"id": 1,
"unitKind": "EPISODE",
"seasonNumber": 1,
"number": 1,
"absoluteNumber": 1,
"releaseDate": "2013-04-07",
"durationMinutes": 24,
"imageUrl": "https://s4.anilist.co/file/anilistcdn/media/anime/episode/1.jpg",
"titles": {
"en": "To You, in 2000 Years",
"ja": "二千年後の君へ"
},
"descriptions": {
"en": "Eren Yeager lives in Shiganshina District..."
},
"seasonName": "Season 1",
"externalIds": [
{
"source": "ANIZIP",
"externalKey": null,
"externalInt": 1
}
]
}
],
"streamingProviders": {
"ANIMEVIETSUB": {
"providerMediaId": "shingeki-no-kyojin",
"similarity": 95.5,
"mappingType": "AUTO"
}
}
}
}

Response lỗi (404 Not Found)

{
"success": false,
"message": "Media not found for query: 99999",
"code": "MEDIA_NOT_FOUND"
}

Lấy Metadata hàng loạt

Lấy metadata cho nhiều media items trong một request.

Tham số

Tham sốKiểuBắt buộcMô tả
idsstringDanh sách ID media phân cách bằng dấu phẩy (ví dụ: 16498,11061,1535)

Ví dụ Request

GET /api/v1/metadata/batch?ids=16498,11061,1535

Response thành công (200 OK)

{
"success": true,
"results": [
{
"id": 16498,
"mediaType": "ANIME",
"format": "TV",
"status": "FINISHED",
"titles": {
"en": "Attack on Titan"
},
"images": {
"coverXl": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx16498-C7FPm3m59CyP.jpg"
}
},
{
"id": 11061,
"mediaType": "ANIME",
"format": "TV",
"status": "FINISHED",
"titles": {
"en": "Hunter x Hunter (2011)"
}
}
],
"found": 2,
"requested": 3
}

Response lỗi (400 Bad Request)

{
"success": false,
"message": "No valid IDs provided",
"code": "INVALID_ID"
}

Các trường Response

Đối tượng MediaDetail

TrườngKiểuMô tả
idintegerID media
mediaTypestringANIME hoặc MANGA
formatstringĐịnh dạng media (ví dụ: TV, MOVIE)
statusstringTrạng thái media
sourcestringNguồn tài liệu (ví dụ: MANGA, ORIGINAL)
countryOfOriginstringMã quốc gia (ví dụ: JP)
startDatestringNgày bắt đầu (YYYY-MM-DD)
endDatestringNgày kết thúc (YYYY-MM-DD)
seasonstringMùa phát hành
seasonYearintegerNăm phát hành
totalUnitsintegerTổng số tập/chương
unitDurationMinintegerThời lượng mỗi unit tính bằng phút
hashtagstringHashtag
createdAtintegerTimestamp tạo (ms)
updatedAtintegerTimestamp cập nhật cuối (ms)
titlesobjectTiêu đề theo ngôn ngữ
descriptionsobjectMô tả theo ngôn ngữ
imagesobjectURL hình ảnh
trailerobjectThông tin trailer
relationsarrayMedia liên quan
genresarrayDanh sách thể loại
studiosarrayDanh sách studio
tagsarrayDanh sách tag
externalIdsarrayID bên ngoài (AniList, MyAnimeList, etc.)
unitsarrayTập/chương
streamingProvidersobjectMapping provider streaming

Đối tượng Provider Mapping

TrườngKiểuMô tả
providerMediaIdstringID media của provider
similaritynumberĐiểm tương đồng khớp (0-100)
mappingTypestringAUTO hoặc MANUAL

Lưu ý

  • Endpoint metadata trả về chi tiết đầy đủ bao gồm tất cả nội dung đã localize
  • Streaming provider mappings cho biết provider streaming nào có media này
  • ⚠️ Lưu ý về Mapping: Do đa số mapping được thực hiện tự động, có thể xảy ra trường hợp mapping sai hoặc thiếu. Nếu bạn phát hiện mapping không chính xác hoặc thiếu provider, vui lòng tham gia Discord của chúng tôi để góp ý và yêu cầu chỉnh sửa.
  • Units (tập/chương) bao gồm tiêu đề và mô tả đã localize
  • External IDs cho phép liên kết với các database khác (AniList, MyAnimeList, etc.)
  • Endpoint batch hiệu quả hơn để lấy nhiều media cùng lúc
  • Media bị thiếu trong batch request sẽ bị bỏ qua im lặng (kiểm tra found vs requested)