Publisher API · v1
Publisher API
Phim, danh mục, tập, link embed. REST + JSON.
Base https://kp-api-hub.devwithai.net/publisher
Xác thực
Bearer token, gắn vào header mọi request. Gọi ở server để không lộ key.
Authorization: Bearer pk_live_xxxconst BASE = process.env.PUBLISHER_API_BASE;
const KEY = process.env.PUBLISHER_API_KEY;
export async function khophim(path) {
const res = await fetch(BASE + path, {
headers: { Authorization: "Bearer " + KEY },
next: { revalidate: 60 },
});
if (!res.ok) throw new Error("API " + res.status);
return res.json();
}Chưa có API key?
Vào trang Đề xuất → chọn loại “Xin cấp API token” → nhập email liên hệ → gửi. Admin duyệt và cấp pk_live_… cho bạn.
GET/movies
Danh sách phim
Danh sách phim, phân trang.
https://kp-api-hub.devwithai.net/publisher/movies
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| sort | query | string | newest | newest / hot. |
| page | query | int | 1 | Trang. |
| page_size | query | int | 24 | 1-60. |
curl -s "https://kp-api-hub.devwithai.net/publisher/movies?sort=newest&page=1&page_size=24" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"status": "success",
"page": 1,
"page_size": 24,
"total": 10432,
"items": [
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
},
{ "...": "các phim khác cùng cấu trúc" }
]
}Trường quan trọng
| items[].id | int | raw_movie_id, dùng cho endpoint /episodes. |
| items[].slug | string | Dùng cho URL chi tiết và endpoint /movies/{slug}. |
| items[].title | string | Tên đã áp override theo site (nếu có). |
| items[].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| items[].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| items[].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| items[].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
| items[].views | int | Tổng lượt xem của phim trên site này. |
| total | int | Tổng số phim khớp, để tính số trang. |
GET/updated
Phim mới cập nhật
Phim vừa thay đổi. Dùng ?hours=N để lấy phim đổi trong N giờ gần nhất; last_change cho biết đổi gì.
https://kp-api-hub.devwithai.net/publisher/updated
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| hours | query | int | — | Số giờ gần nhất (1-720). |
| order | query | string | desc | desc / asc. |
| page | query | int | 1 | Trang. |
| page_size | query | int | 24 | 1-60. |
| since | query | string | — | ISO-8601 (tuỳ chọn). |
curl -s "https://kp-api-hub.devwithai.net/publisher/updated?hours=2&page=1&page_size=50" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"status": "success",
"page": 1,
"page_size": 50,
"total": 7,
"items": [
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
},
{ "...": "các phim khác vừa đổi" }
]
}Trường quan trọng
| items[].last_change.kind | string | new_movie | new_episode | quality | updated. |
| items[].last_change.episodes_added | string[] | Tập vừa có nguồn, ví dụ ["Tập 10", "Tập 11", "Tập 12"]. |
| items[].last_change.quality_from / to | string | Chất lượng cũ sang mới khi kind = quality. |
| items[].synced_at | string | ISO-8601, mốc dữ liệu đổi gần nhất. |
| items[].episode_current / latest_episode | int / string | Số tập đã có nguồn và nhãn tập mới nhất. |
| items[].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| items[].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| items[].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| items[].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
| total | int | Số phim đổi trong cửa sổ. 0 nếu không có gì. |
GET/search
Tìm kiếm phim
Tìm theo từ khóa, kết quả giống /movies.
https://kp-api-hub.devwithai.net/publisher/search
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| q | query | string | — | Từ khóa. Bắt buộc. |
| page | query | int | 1 | Trang. |
| page_size | query | int | 24 | 1-60. |
curl -s "https://kp-api-hub.devwithai.net/publisher/search?q=mua%20he&page=1" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"status": "success",
"page": 1,
"page_size": 24,
"total": 3,
"items": [
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
}
]
}Trường quan trọng
| items[].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| items[].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| items[].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| items[].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
GET/movies/tmdb/{tmdb_id}
Tìm phim theo TMDB
Map phim theo TMDB id. Phim TV nhiều mùa trả nhiều kết quả.
https://kp-api-hub.devwithai.net/publisher/movies/tmdb/{tmdb_id}
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| tmdb_id | path | int | — | TMDB id. Bắt buộc. |
| tmdb_type | query | string | — | movie / tv. |
curl -s "https://kp-api-hub.devwithai.net/publisher/movies/tmdb/853636" \
-H "Authorization: Bearer pk_live_xxxxxxxx"[
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
}
]Trường quan trọng
| [].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| [].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| [].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| [].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
GET/categories
Danh mục
Thể loại, quốc gia, loại phim và tag của site.
https://kp-api-hub.devwithai.net/publisher/categories
Tham số
Không có tham số.
curl -s "https://kp-api-hub.devwithai.net/publisher/categories" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"genres": [
{
"id": 6,
"name": "Phim Hành Động",
"slug": "phim-hanh-dong",
"description": "Những bộ phim hành động gay cấn, nhịp nhanh.",
"is_group": false,
"members": [],
"image_url": null
}
],
"countries": [
{ "id": 1, "name": "Việt Nam", "slug": "viet-nam", "description": null, "is_group": false, "members": [], "image_url": null }
],
"movie_types": [
{ "id": 1, "name": "Phim Bộ", "slug": "phim-bo", "description": null, "is_group": false, "members": [], "image_url": null }
],
"tags": []
}Trường quan trọng
| <loại>[].slug | string | Dùng dựng URL trang danh mục. |
| <loại>[].description | string | null | Block text SEO của danh mục, đặt theo site ở dashboard. |
| <loại>[].is_group | bool | true = nhóm gộp nhiều danh mục; members chứa id các danh mục gốc bên trong. |
GET/categories/{type}
Danh mục theo loại
Lấy riêng một loại danh mục: genre, country, movie_type, tag.
https://kp-api-hub.devwithai.net/publisher/categories/{type}
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| type | path | string | — | genre | country | movie_type | tag. Bắt buộc. |
curl -s "https://kp-api-hub.devwithai.net/publisher/categories/country" \
-H "Authorization: Bearer pk_live_xxxxxxxx"[
{
"id": 1,
"name": "Việt Nam",
"slug": "viet-nam",
"description": null,
"is_group": false,
"members": [],
"image_url": null
},
{
"id": 7,
"name": "Hàn Quốc",
"slug": "han-quoc",
"description": null,
"is_group": false,
"members": [],
"image_url": null
}
]GET/category/{type}/{slug}
Phim theo danh mục
Phim trong một danh mục, phân trang.
https://kp-api-hub.devwithai.net/publisher/category/{type}/{slug}
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| type | path | string | — | genre | country | movie_type | tag. Bắt buộc. |
| slug | path | string | — | Slug danh mục. Bắt buộc. |
| sort | query | string | newest | newest / hot. |
| page | query | int | 1 | Trang. |
| page_size | query | int | 24 | 1-60. |
curl -s "https://kp-api-hub.devwithai.net/publisher/category/genre/phim-hanh-dong?sort=newest&page=1" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"status": "success",
"page": 1,
"page_size": 24,
"total": 312,
"items": [
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
}
]
}Trường quan trọng
| items[].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| items[].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| items[].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| items[].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
GET/movies/{slug}
Chi tiết phim
Chi tiết phim: mô tả, danh mục, diễn viên, đạo diễn, mùa khác.
https://kp-api-hub.devwithai.net/publisher/movies/{slug}
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| slug | path | string | — | Slug phim. Bắt buộc. |
curl -s "https://kp-api-hub.devwithai.net/publisher/movies/mua-he-nam-ay-2026" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"raw_movie_id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"origin_name": "That Summer",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"year": 2026,
"quality": "FHD",
"vote_average": null,
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"views": 128,
"trailer_url": null,
"is_cinema": false,
"duration": null,
"genres": [{ "id": 2, "name": "Phim Chính Kịch" }],
"countries": [{ "id": 1, "name": "Việt Nam" }],
"movie_types": [{ "id": 1, "name": "Phim Bộ" }],
"tags": [],
"actors": [
{
"id": 50123,
"name": "Diễn viên A",
"character": "Vai chính",
"image_url": "https://image.tmdb.org/t/p/w300/xxx.jpg",
"image_url_b2": null
}
],
"directors": [
{ "id": 50999, "name": "Đạo diễn B", "character": null, "image_url": null, "image_url_b2": null }
],
"other_seasons": [
{
"id": 983,
"slug": "mua-he-nam-ay-2-2027",
"name": "Mùa Hè Năm Ấy 2",
"season_number": 2,
"year": 2027,
"poster_url": null,
"poster_url_b2": null
}
]
}Trường quan trọng
| raw_movie_id | int | Dùng cho endpoint /movies/{raw_movie_id}/episodes. |
| poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
| genres / countries / movie_types / tags | array | { id, name }, tên đã áp override. |
| actors / directors | array | { id, name, character, image_url, image_url_b2 }. |
| other_seasons | array | Các mùa hoặc phần khác cùng series. Poster dùng poster_url_b2, fallback poster_url khi null. |
GET/movies/{raw_movie_id}/episodes
Tập + link embed
Danh sách tập và nguồn phát. Mỗi nguồn là một embed_url đã ký, đặt thẳng vào iframe.
https://kp-api-hub.devwithai.net/publisher/movies/{raw_movie_id}/episodes
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| raw_movie_id | path | int | — | Từ chi tiết phim. Bắt buộc. |
curl -s "https://kp-api-hub.devwithai.net/publisher/movies/982/episodes" \
-H "Authorization: Bearer pk_live_xxxxxxxx"[
{
"id": 14551,
"episode_label": "Tập 01",
"slug": "tap-1",
"order_index": 1,
"sources": [
{
"video_source_id": 16692,
"language_name": "Vietsub",
"embed_url": "https://kp-api-hub.devwithai.net/embed/8/16692?ts=1790692943&sig=9f1c2a…"
}
]
},
{ "...": "các tập còn lại" }
]Trường quan trọng
| [].episode_label | string | Nhãn tập, ví dụ "Tập 01". |
| [].sources[].embed_url | string | Link iframe đã ký, hết hạn sau khoảng 5 phút. Gọi lại khi cần, không lưu cứng. |
| [].sources[].language_name | string | null | Vietsub, thuyết minh, lồng tiếng… |
GET/blocks
Khối trang chủ (blocks)
Các khối trang chủ: slider, top xem nhiều, theo thể loại. Mỗi khối có items là danh sách phim.
https://kp-api-hub.devwithai.net/publisher/blocks
Tham số
Không có tham số.
curl -s "https://kp-api-hub.devwithai.net/publisher/blocks" \
-H "Authorization: Bearer pk_live_xxxxxxxx"[
{
"keyword": "hot-tuan",
"title": "Phim hot trong tuần",
"block_type": "query",
"link": { "type": "category", "value": "phim-hanh-dong", "name": "Phim Hành Động" },
"items": [
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
}
]
},
{ "...": "các block khác theo thứ tự đã sắp ở dashboard" }
]Trường quan trọng
| [].keyword | string | Định danh block, dùng cho /blocks/{keyword}. |
| [].block_type | string | query (tự lọc), curated (chọn tay), hoặc custom (banner tự do). |
| [].link | object | null | Link Xem tất cả của block (category hoặc manual). |
| [].items | array | Danh sách phim cùng cấu trúc /movies. |
| [].items[].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| [].items[].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| [].items[].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| [].items[].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
GET/blocks/{keyword}
Chi tiết một block
Lấy riêng một block theo keyword, ví dụ để render trang xem tất cả.
https://kp-api-hub.devwithai.net/publisher/blocks/{keyword}
Tham số
| Tham số | Vị trí | Kiểu | Mặc định | Mô tả |
|---|---|---|---|---|
| keyword | path | string | — | keyword block. Bắt buộc. |
curl -s "https://kp-api-hub.devwithai.net/publisher/blocks/hot-tuan" \
-H "Authorization: Bearer pk_live_xxxxxxxx"{
"keyword": "hot-tuan",
"title": "Phim hot trong tuần",
"block_type": "query",
"link": { "type": "category", "value": "phim-hanh-dong", "name": "Phim Hành Động" },
"items": [
{
"item_type": "movie",
"id": 982,
"slug": "mua-he-nam-ay-2026",
"title": "Mùa Hè Năm Ấy",
"poster_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-poster.webp",
"poster_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/poster.webp",
"thumb_url": "https://phimimg.com/uploads/movies/20260808/mua-he-nam-ay-2026-thumb.webp",
"thumb_url_b2": "https://b.cdnx1.tech/images/mua-he-nam-ay-2026/thumb.webp",
"description": "Lấy bối cảnh trải dài giữa thanh xuân và hiện tại sau gần một thập kỷ...",
"year": 2026,
"genres": [{ "id": 2, "name": "Phim Chính Kịch", "slug": "phim-chinh-kich" }],
"quality": "FHD",
"status": "ongoing",
"has_seasons": true,
"episode_total": 40,
"episode_current": 12,
"latest_episode": "Tập 12",
"views": 128,
"updated_at": "2026-09-28T14:03:11+00:00",
"synced_at": "2026-09-30T09:15:42+00:00",
"last_change": {
"at": "2026-09-30T09:15:42+00:00",
"kind": "new_episode",
"episodes_added": ["Tập 10", "Tập 11", "Tập 12"],
"quality_from": null,
"quality_to": null
},
"image_url": null,
"link_url": null,
"image_ratio": null
}
]
}Trường quan trọng
| items[].poster_url_b2 | string | null | Poster webp trên CDN. Dùng field này để hiển thị poster. |
| items[].thumb_url_b2 | string | null | Thumbnail webp trên CDN. Dùng field này để hiển thị ảnh nhỏ. |
| items[].poster_url | string | null | Poster gốc. Chỉ dùng khi poster_url_b2 là null. |
| items[].thumb_url | string | null | Thumbnail gốc. Chỉ dùng khi thumb_url_b2 là null. |
Mã lỗi
| HTTP | Body | Khi nào |
|---|---|---|
| 401 | { "detail": "Missing Authorization: Bearer <api_key>" } | Thiếu header Authorization. |
| 401 | { "detail": "Invalid or revoked API key" } | Key sai hoặc đã bị thu hồi. |
| 404 | { "detail": "Movie not found" } | Slug phim không tồn tại. |
| 404 | { "detail": "Block not found" } | keyword block không tồn tại. |
| 422 | { "detail": [ … ] } | Tham số query sai kiểu hoặc thiếu, ví dụ thiếu q ở /search. |
