Tổng quan API
Chào mừng bạn đến với tài liệu API — hệ thống RESTful cung cấp dữ liệu phim phong phú, cập nhật liên tục. Mọi phản hồi ở định dạng JSON, mã hóa UTF-8, dùng phương thức GET.
| Base URL | https://phimapi.com |
|---|---|
| Định dạng | JSON |
| Mã hóa | UTF-8 |
| Phương thức | GET |
- Thông tin chi tiết phim
- Hình ảnh HD từ TMDB
- Thông tin diễn viên, đạo diễn
- Từ khóa phim
- Tìm kiếm theo từ khóa
- Lọc theo thể loại, quốc gia
- Sắp xếp theo nhiều tiêu chí
- Phân trang linh hoạt
Bộ lọc & Sắp xếp
Áp dụng cho các endpoint danh sách (/v1/api/danh-sach, /the-loai/{slug}, /quoc-gia/{slug}, /nam/{year}, /tim-kiem…).
| Tham số | Giá trị | Mô tả |
|---|---|---|
page | integer | Trang hiện tại (mặc định 1). |
category | slug | Lọc theo thể loại, ví dụ hanh-dong. |
country | slug | Lọc theo quốc gia, ví dụ han-quoc. |
year | number | Lọc theo năm phát hành, ví dụ 2024. |
sort_field | string | modified.time | _id | year (mặc định modified.time). |
sort_type | string | desc | asc (mặc định desc). |
sort_lang | string | vietsub | thuyet-minh | long-tieng. |
limit | integer | Số phim mỗi trang (áp dụng ở tìm kiếm; mặc định 10). |
Lấy danh sách phim mới cập nhật
Danh sách phim mới nhất theo định dạng cổ điển (Format 1). Có 2 biến thể chi tiết hơn: thêm hậu tố -v2 và -v3 (bổ sung trường và ảnh IMDB/TMDB đầy đủ).
curl --request GET \ --url 'https://phimapi.com/danh-sach/phim-moi-cap-nhat' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/danh-sach/phim-moi-cap-nhat', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/danh-sach/phim-moi-cap-nhat')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/danh-sach/phim-moi-cap-nhat');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/danh-sach/phim-moi-cap-nhat',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/danh-sach/phim-moi-cap-nhat")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/danh-sach/phim-moi-cap-nhat"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/danh-sach/phim-moi-cap-nhat')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/danh-sach/phim-moi-cap-nhat")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách phim mới nhất theo định dạng cổ điển (Format 1). Có 2 biến thể chi tiết hơn: thêm hậu tố -v2 và -v3 (bổ sung trường và ảnh IMDB/TMDB đầy đủ).
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
page |
integer | Không | Trang hiện tại (mặc định 1). |
{
"status": true,
"msg": "done",
"items": [
{
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"poster_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"thumb_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"year": 2022
}
],
"pagination": {
"totalItems": 100,
"totalItemsPerPage": 24,
"currentPage": 1,
"totalPages": 5
}
}
https://phimapi.com/danh-sach/phim-moi-cap-nhat
Phim mới — định dạng v1
Danh sách "Phim Mới" theo định dạng v1 (Format 2), kèm khối seoOnPage, breadCrumb, params. Không cần slug. Hỗ trợ toàn bộ bộ lọc chung.
curl --request GET \ --url 'https://phimapi.com/v1/api/danh-sach?page=1' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/danh-sach?page=1', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/danh-sach?page=1')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/danh-sach?page=1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/danh-sach?page=1',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/danh-sach?page=1")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/danh-sach?page=1"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/danh-sach?page=1')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/danh-sach?page=1")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách "Phim Mới" theo định dạng v1 (Format 2), kèm khối seoOnPage, breadCrumb, params. Không cần slug. Hỗ trợ toàn bộ bộ lọc chung.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
page |
integer | Không | Trang hiện tại (mặc định 1). |
category |
slug | Không | Lọc theo thể loại, ví dụ hanh-dong. |
country |
slug | Không | Lọc theo quốc gia, ví dụ han-quoc. |
year |
number | Không | Lọc theo năm phát hành, ví dụ 2024. |
sort_field |
string | Không | modified.time | _id | year (mặc định modified.time). |
sort_type |
string | Không | desc | asc (mặc định desc). |
sort_lang |
string | Không | vietsub | thuyet-minh | long-tieng. |
{
"status": "success",
"message": "",
"data": {
"items": [
{
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"type": "hoathinh",
"thumb_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"poster_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"sub_docquyen": false,
"chieurap": true,
"time": "105 phút",
"episode_current": "Full",
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"year": 2022,
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"last_episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"name": "Full"
}
]
}
],
"params": {
"type_slug": "danh-sach",
"slug": "",
"filterCategory": [
""
],
"filterCountry": [
""
],
"filterYear": "",
"filterType": "",
"sortField": "modified.time",
"sortType": "desc",
"pagination": {
"totalItems": 100,
"totalItemsPerPage": 24,
"currentPage": 1,
"pageRanges": 5
}
}
}
}
https://phimapi.com/v1/api/danh-sach?page=1
Danh sách phim theo loại
Lấy phim theo loại (định dạng cổ điển - Format 1). type nhận: phim-le, phim-bo, hoat-hinh, tv-shows.
curl --request GET \ --url 'https://phimapi.com/danh-sach/phim-bo' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/danh-sach/phim-bo', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/danh-sach/phim-bo')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/danh-sach/phim-bo');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/danh-sach/phim-bo',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/danh-sach/phim-bo")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/danh-sach/phim-bo"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/danh-sach/phim-bo')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/danh-sach/phim-bo")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Lấy phim theo loại (định dạng cổ điển - Format 1). type nhận: phim-le, phim-bo, hoat-hinh, tv-shows.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
type |
string | Có | phim-le | phim-bo | hoat-hinh | tv-shows. |
page |
integer | Không | Trang hiện tại. |
{
"status": true,
"msg": "done",
"items": [
{
"tmdb": {
"id": "233968",
"type": "tv",
"season": 1,
"vote_average": 9,
"vote_count": 2
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2025-06-26T08:57:10.000Z"
},
"_id": "5694b3b8e68d534f207261f9217afb73",
"name": "A Mạch Tòng Quân",
"slug": "a-mach-tong-quan",
"origin_name": "Fighting For Love",
"poster_url": "https://img.phimapi.com/upload/vod/20250626-1/e1e5b9…",
"thumb_url": "https://img.phimapi.com/upload/vod/20250626-1/e1e5b9…",
"year": 2024
}
],
"pagination": {
"totalItems": 16,
"totalItemsPerPage": 24,
"currentPage": 1,
"totalPages": 1
}
}
https://phimapi.com/danh-sach/phim-bo
Danh sách theo loại — bộ lọc đầy đủ
Giống trên nhưng theo định dạng v1 đầy đủ (seoOnPage, breadCrumb, params.pagination) và hỗ trợ mọi tham số ở Bộ lọc & Sắp xếp.
curl --request GET \ --url 'https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Giống trên nhưng theo định dạng v1 đầy đủ (seoOnPage, breadCrumb, params.pagination) và hỗ trợ mọi tham số ở Bộ lọc & Sắp xếp.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
type |
string | Có | phim-le | phim-bo | hoat-hinh | tv-shows. |
page |
integer | Không | Trang hiện tại (mặc định 1). |
category |
slug | Không | Lọc theo thể loại, ví dụ hanh-dong. |
country |
slug | Không | Lọc theo quốc gia, ví dụ han-quoc. |
year |
number | Không | Lọc theo năm phát hành, ví dụ 2024. |
sort_field |
string | Không | modified.time | _id | year (mặc định modified.time). |
sort_type |
string | Không | desc | asc (mặc định desc). |
sort_lang |
string | Không | vietsub | thuyet-minh | long-tieng. |
{
"status": true,
"msg": "done",
"data": {
"items": [
{
"tmdb": {
"id": "703451",
"type": "movie",
"season": null,
"vote_average": 6.278,
"vote_count": 828
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-12T15:48:47.000Z"
},
"_id": "7647966b7343c29048673252e490f736",
"name": "Chỗ em hay chỗ anh?",
"slug": "cho-em-hay-cho-anh",
"origin_name": "Your Place or Mine",
"alternative_names": [],
"type": "single",
"thumb_url": "a5f56a6ca69f2134a75651dd246bf1c0.jpg",
"poster_url": "a5f56a6ca69f2134a75651dd246bf1c0.jpg",
"sub_docquyen": false,
"chieurap": false,
"time": "109 phút",
"episode_current": "Full",
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"year": 2023,
"category": [
{
"name": "Tình Cảm",
"slug": "tinh-cam",
"id": "6a4927308e6c3c87500b8016"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"last_episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"name": "Full"
}
]
}
],
"params": {
"type_slug": "danh-sach",
"slug": "phim-le",
"filterCategory": [
""
],
"filterCountry": [
""
],
"filterYear": "",
"filterType": "",
"sortField": "modified.time",
"sortType": "desc",
"pagination": {
"totalItems": 71,
"totalItemsPerPage": 24,
"currentPage": 1,
"pageRanges": 5
}
}
}
}
https://phimapi.com/v1/api/danh-sach/phim-le?country=han-quoc&year=2024
Thông tin phim (Format 1)
Chi tiết một phim theo slug, gồm thông tin phim và danh sách tập (episodes tách ngoài movie).
curl --request GET \ --url 'https://phimapi.com/phim/ten-phim-slug' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/phim/ten-phim-slug', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/phim/ten-phim-slug')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/phim/ten-phim-slug');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/phim/ten-phim-slug',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/phim/ten-phim-slug")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/phim/ten-phim-slug"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/phim/ten-phim-slug')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/phim/ten-phim-slug")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Chi tiết một phim theo slug, gồm thông tin phim và danh sách tập (episodes tách ngoài movie).
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug của phim. |
{
"status": true,
"msg": "",
"movie": {
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"created": {
"time": "2023-09-13T03:39:44.000Z"
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"content": "<p>Bộ phim kể về chuyến hành trình hành động kết h…",
"type": "hoathinh",
"status": "completed",
"thumb_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"poster_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"is_copyright": false,
"sub_docquyen": false,
"chieurap": true,
"is_published": true,
"trailer_url": "https://www.youtube.com/watch?v=eMZVWnhGeEE",
"time": "105 phút",
"episode_current": "Full",
"episode_total": 1,
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"notify": "",
"showtimes": "",
"year": 2022,
"view": 0,
"actor": [
"Chris Evans"
],
"director": [
"Angus MacLane"
],
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
]
},
"episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"server_data": [
{
"name": "Full",
"slug": "full",
"filename": "Lightyear: Cảnh Sát Vũ Trụ - Lightyear - 2022 - FH…",
"link_embed": "https://player.phimapi.com/player/?url=https://s6.…",
"link_m3u8": "https://s6.kkphimplayer6.com/20260123/t2a4G3hc/ind…"
}
]
}
]
}
https://phimapi.com/phim/ten-phim-slug
Thông tin phim theo ID
Như Format 1 nhưng tra cứu theo _id của phim thay vì slug.
curl --request GET \ --url 'https://phimapi.com/phim/id/665f0a1b2c3d4e5f' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/phim/id/665f0a1b2c3d4e5f', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/phim/id/665f0a1b2c3d4e5f')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/phim/id/665f0a1b2c3d4e5f');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/phim/id/665f0a1b2c3d4e5f',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/phim/id/665f0a1b2c3d4e5f")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/phim/id/665f0a1b2c3d4e5f"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/phim/id/665f0a1b2c3d4e5f')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/phim/id/665f0a1b2c3d4e5f")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Như Format 1 nhưng tra cứu theo _id của phim thay vì slug.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
id |
string | Có | _id của phim. |
{
"status": true,
"msg": "",
"movie": {
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"created": {
"time": "2023-09-13T03:39:44.000Z"
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"content": "<p>Bộ phim kể về chuyến hành trình hành động kết h…",
"type": "hoathinh",
"status": "completed",
"thumb_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"poster_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"is_copyright": false,
"sub_docquyen": false,
"chieurap": true,
"is_published": true,
"trailer_url": "https://www.youtube.com/watch?v=eMZVWnhGeEE",
"time": "105 phút",
"episode_current": "Full",
"episode_total": 1,
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"notify": "",
"showtimes": "",
"year": 2022,
"view": 0,
"actor": [
"Chris Evans"
],
"director": [
"Angus MacLane"
],
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
]
},
"episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"server_data": [
{
"name": "Full",
"slug": "full",
"filename": "Lightyear: Cảnh Sát Vũ Trụ - Lightyear - 2022 - FH…",
"link_embed": "https://player.phimapi.com/player/?url=https://s6.…",
"link_m3u8": "https://s6.kkphimplayer6.com/20260123/t2a4G3hc/ind…"
}
]
}
]
}
https://phimapi.com/phim/id/665f0a1b2c3d4e5f
Thông tin phim theo TMDB
Tra cứu phim theo mã TheMovieDB. type là movie hoặc tv.
curl --request GET \ --url 'https://phimapi.com/tmdb/movie/299534' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/tmdb/movie/299534', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/tmdb/movie/299534')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/tmdb/movie/299534');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/tmdb/movie/299534',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/tmdb/movie/299534")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/tmdb/movie/299534"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/tmdb/movie/299534')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/tmdb/movie/299534")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Tra cứu phim theo mã TheMovieDB. type là movie hoặc tv.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
type |
string | Có | movie | tv. |
id |
number | Có | ID của TMDB. |
{
"status": true,
"msg": "",
"movie": {
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"created": {
"time": "2023-09-13T03:39:44.000Z"
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"content": "<p>Bộ phim kể về chuyến hành trình hành động kết h…",
"type": "hoathinh",
"status": "completed",
"thumb_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"poster_url": "https://img.phimapi.com/upload/vod/20260123-1/c34d0d…",
"is_copyright": false,
"sub_docquyen": false,
"chieurap": true,
"is_published": true,
"trailer_url": "https://www.youtube.com/watch?v=eMZVWnhGeEE",
"time": "105 phút",
"episode_current": "Full",
"episode_total": 1,
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"notify": "",
"showtimes": "",
"year": 2022,
"view": 0,
"actor": [
"Chris Evans"
],
"director": [
"Angus MacLane"
],
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
]
},
"episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"server_data": [
{
"name": "Full",
"slug": "full",
"filename": "Lightyear: Cảnh Sát Vũ Trụ - Lightyear - 2022 - FH…",
"link_embed": "https://player.phimapi.com/player/?url=https://s6.…",
"link_m3u8": "https://s6.kkphimplayer6.com/20260123/t2a4G3hc/ind…"
}
]
}
]
}
https://phimapi.com/tmdb/movie/299534
Thông tin phim (Format 2)
Chi tiết phim theo định dạng v1 (Format 2), bọc trong data kèm seoOnPage, breadCrumb, item (chứa cả episodes).
curl --request GET \ --url 'https://phimapi.com/v1/api/phim/ten-phim-slug' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/phim/ten-phim-slug', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/phim/ten-phim-slug')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/phim/ten-phim-slug');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/phim/ten-phim-slug',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/phim/ten-phim-slug")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/phim/ten-phim-slug"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/phim/ten-phim-slug')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/phim/ten-phim-slug")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Chi tiết phim theo định dạng v1 (Format 2), bọc trong data kèm seoOnPage, breadCrumb, item (chứa cả episodes).
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug của phim. |
{
"status": "success",
"message": "",
"data": {
"params": {
"slug": "lightyear-canh-sat-vu-tru",
"includeUnpublished": false
},
"item": {
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"created": {
"time": "2023-09-13T03:39:44.000Z"
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"content": "<p>Bộ phim kể về chuyến hành trình hành động kết h…",
"type": "hoathinh",
"status": "completed",
"thumb_url": "upload/vod/20260123-1/c34d0de9b0d8383ae31ac2d13e74…",
"poster_url": "upload/vod/20260123-1/c34d0de9b0d8383ae31ac2d13e74…",
"is_copyright": false,
"sub_docquyen": false,
"chieurap": true,
"is_published": true,
"trailer_url": "https://www.youtube.com/watch?v=eMZVWnhGeEE",
"time": "105 phút",
"episode_current": "Full",
"episode_total": 1,
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"notify": "",
"showtimes": "",
"year": 2022,
"view": 0,
"actor": [
"Chris Evans"
],
"director": [
"Angus MacLane"
],
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"server_data": [
{
"name": "Full",
"slug": "full",
"filename": "Lightyear: Cảnh Sát Vũ Trụ - Lightyear - 2022 - FH…",
"link_embed": "https://player.phimapi.com/player/?url=https://s6.…",
"link_m3u8": "https://s6.kkphimplayer6.com/20260123/t2a4G3hc/ind…"
}
]
}
]
}
}
}
https://phimapi.com/v1/api/phim/ten-phim-slug
Hình ảnh của phim
Danh sách hình ảnh (poster, backdrop…) của phim.
curl --request GET \ --url 'https://phimapi.com/v1/api/phim/ten-phim-slug/images' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/phim/ten-phim-slug/images', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/phim/ten-phim-slug/images')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/phim/ten-phim-slug/images');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/phim/ten-phim-slug/images',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/phim/ten-phim-slug/images")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/phim/ten-phim-slug/images"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/phim/ten-phim-slug/images')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/phim/ten-phim-slug/images")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách hình ảnh (poster, backdrop…) của phim.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug của phim. |
{
"success": true,
"message": "success",
"status_code": 200,
"data": {
"tmdb_id": 718789,
"tmdb_type": "movie",
"ophim_id": "54229abfcfa5649e7003b83dd4755294",
"slug": "lightyear-canh-sat-vu-tru",
"imdb_id": null,
"image_sizes": {
"backdrop": {
"original": "https://image.tmdb.org/t/p/original",
"w1280": "https://image.tmdb.org/t/p/w1280",
"w300": "https://image.tmdb.org/t/p/w300",
"w780": "https://image.tmdb.org/t/p/w780"
},
"poster": {
"original": "https://image.tmdb.org/t/p/original",
"w154": "https://image.tmdb.org/t/p/w154",
"w185": "https://image.tmdb.org/t/p/w185",
"w342": "https://image.tmdb.org/t/p/w342",
"w500": "https://image.tmdb.org/t/p/w500",
"w780": "https://image.tmdb.org/t/p/w780",
"w92": "https://image.tmdb.org/t/p/w92"
}
},
"images": []
}
}
https://phimapi.com/v1/api/phim/ten-phim-slug/images
Diễn viên & ê-kíp
Danh sách diễn viên, đạo diễn và nhân sự của phim.
curl --request GET \ --url 'https://phimapi.com/v1/api/phim/ten-phim-slug/peoples' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/phim/ten-phim-slug/peoples', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/phim/ten-phim-slug/peoples')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/phim/ten-phim-slug/peoples');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/phim/ten-phim-slug/peoples',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/phim/ten-phim-slug/peoples")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/phim/ten-phim-slug/peoples"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/phim/ten-phim-slug/peoples')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/phim/ten-phim-slug/peoples")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách diễn viên, đạo diễn và nhân sự của phim.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug của phim. |
{
"success": true,
"message": "success",
"status_code": 200,
"data": {
"tmdb_id": 718789,
"tmdb_type": "movie",
"ophim_id": "54229abfcfa5649e7003b83dd4755294",
"slug": "lightyear-canh-sat-vu-tru",
"imdb_id": null,
"profile_sizes": {
"h632": "https://image.tmdb.org/t/p/h632",
"original": "https://image.tmdb.org/t/p/original",
"w185": "https://image.tmdb.org/t/p/w185",
"w45": "https://image.tmdb.org/t/p/w45"
},
"peoples": []
}
}
https://phimapi.com/v1/api/phim/ten-phim-slug/peoples
Từ khóa của phim
Danh sách từ khóa (keywords) gắn với phim.
curl --request GET \ --url 'https://phimapi.com/v1/api/phim/ten-phim-slug/keywords' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/phim/ten-phim-slug/keywords', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/phim/ten-phim-slug/keywords')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/phim/ten-phim-slug/keywords');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/phim/ten-phim-slug/keywords',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/phim/ten-phim-slug/keywords")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/phim/ten-phim-slug/keywords"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/phim/ten-phim-slug/keywords')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/phim/ten-phim-slug/keywords")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách từ khóa (keywords) gắn với phim.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug của phim. |
{
"success": true,
"message": "success",
"status_code": 200,
"data": {
"tmdb_id": 718789,
"tmdb_type": "movie",
"ophim_id": "54229abfcfa5649e7003b83dd4755294",
"slug": "lightyear-canh-sat-vu-tru",
"imdb_id": null,
"keywords": []
}
}
https://phimapi.com/v1/api/phim/ten-phim-slug/keywords
Danh sách thể loại
Lấy toàn bộ thể loại (tên + slug). Cũng có bản v1: /v1/api/the-loai.
curl --request GET \ --url 'https://phimapi.com/the-loai' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/the-loai', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/the-loai')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/the-loai');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/the-loai',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/the-loai")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/the-loai"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/the-loai')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/the-loai")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Lấy toàn bộ thể loại (tên + slug). Cũng có bản v1: /v1/api/the-loai.
Endpoint này không có tham số.
{
"status": "success",
"message": "",
"data": {
"items": [
{
"_id": "6a4927308e6c3c87500b802a",
"name": "Bí Ẩn",
"slug": "bi-an"
}
]
}
}
https://phimapi.com/the-loai
Phim theo thể loại
Danh sách phim thuộc một thể loại, hỗ trợ bộ lọc chung.
curl --request GET \ --url 'https://phimapi.com/v1/api/the-loai/hanh-dong?page=1' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/the-loai/hanh-dong?page=1', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/the-loai/hanh-dong?page=1')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/the-loai/hanh-dong?page=1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/the-loai/hanh-dong?page=1',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/the-loai/hanh-dong?page=1")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/the-loai/hanh-dong?page=1"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/the-loai/hanh-dong?page=1')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/the-loai/hanh-dong?page=1")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách phim thuộc một thể loại, hỗ trợ bộ lọc chung.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug thể loại. |
page |
integer | Không | Trang hiện tại (mặc định 1). |
category |
slug | Không | Lọc theo thể loại, ví dụ hanh-dong. |
country |
slug | Không | Lọc theo quốc gia, ví dụ han-quoc. |
year |
number | Không | Lọc theo năm phát hành, ví dụ 2024. |
sort_field |
string | Không | modified.time | _id | year (mặc định modified.time). |
sort_type |
string | Không | desc | asc (mặc định desc). |
sort_lang |
string | Không | vietsub | thuyet-minh | long-tieng. |
{
"status": true,
"msg": "done",
"data": {
"items": [
{
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"type": "hoathinh",
"thumb_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"poster_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"sub_docquyen": false,
"chieurap": true,
"time": "105 phút",
"episode_current": "Full",
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"year": 2022,
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"last_episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"name": "Full"
}
]
}
],
"params": {
"type_slug": "the-loai",
"slug": "khoa-hoc",
"filterCategory": [
"khoa-hoc"
],
"filterCountry": [
""
],
"filterYear": "",
"filterType": "",
"sortField": "modified.time",
"sortType": "desc",
"pagination": {
"totalItems": 23,
"totalItemsPerPage": 24,
"currentPage": 1,
"pageRanges": 5
}
}
}
}
https://phimapi.com/v1/api/the-loai/hanh-dong?page=1
Danh sách quốc gia
Lấy toàn bộ quốc gia (tên + slug). Cũng có bản v1: /v1/api/quoc-gia.
curl --request GET \ --url 'https://phimapi.com/quoc-gia' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/quoc-gia', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/quoc-gia')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/quoc-gia');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/quoc-gia',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/quoc-gia")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/quoc-gia"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/quoc-gia')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/quoc-gia")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Lấy toàn bộ quốc gia (tên + slug). Cũng có bản v1: /v1/api/quoc-gia.
Endpoint này không có tham số.
{
"status": "success",
"message": "",
"data": {
"items": [
{
"_id": "6a4927308e6c3c87500b8008",
"name": "Anh",
"slug": "anh"
}
]
}
}
https://phimapi.com/quoc-gia
Phim theo quốc gia
Danh sách phim thuộc một quốc gia, hỗ trợ bộ lọc chung.
curl --request GET \ --url 'https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách phim thuộc một quốc gia, hỗ trợ bộ lọc chung.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug |
string | Có | Slug quốc gia. |
page |
integer | Không | Trang hiện tại (mặc định 1). |
category |
slug | Không | Lọc theo thể loại, ví dụ hanh-dong. |
country |
slug | Không | Lọc theo quốc gia, ví dụ han-quoc. |
year |
number | Không | Lọc theo năm phát hành, ví dụ 2024. |
sort_field |
string | Không | modified.time | _id | year (mặc định modified.time). |
sort_type |
string | Không | desc | asc (mặc định desc). |
sort_lang |
string | Không | vietsub | thuyet-minh | long-tieng. |
{
"status": true,
"msg": "done",
"data": {
"items": [
{
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"type": "hoathinh",
"thumb_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"poster_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"sub_docquyen": false,
"chieurap": true,
"time": "105 phút",
"episode_current": "Full",
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"year": 2022,
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"last_episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"name": "Full"
}
]
}
],
"params": {
"type_slug": "quoc-gia",
"slug": "au-my",
"filterCategory": [
""
],
"filterCountry": [
"au-my"
],
"filterYear": "",
"filterType": "",
"sortField": "modified.time",
"sortType": "desc",
"pagination": {
"totalItems": 51,
"totalItemsPerPage": 24,
"currentPage": 1,
"pageRanges": 5
}
}
}
}
https://phimapi.com/v1/api/quoc-gia/han-quoc?year=2024
Phim theo năm phát hành
Danh sách phim theo năm phát hành, hỗ trợ bộ lọc chung.
curl --request GET \ --url 'https://phimapi.com/v1/api/nam/2024?category=hoat-hinh' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/nam/2024?category=hoat-hinh', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/nam/2024?category=hoat-hinh')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/nam/2024?category=hoat-hinh');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/nam/2024?category=hoat-hinh',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/nam/2024?category=hoat-hinh")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/nam/2024?category=hoat-hinh"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/nam/2024?category=hoat-hinh')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/nam/2024?category=hoat-hinh")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Danh sách phim theo năm phát hành, hỗ trợ bộ lọc chung.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
year |
number | Có | Năm phát hành. |
page |
integer | Không | Trang hiện tại (mặc định 1). |
category |
slug | Không | Lọc theo thể loại, ví dụ hanh-dong. |
country |
slug | Không | Lọc theo quốc gia, ví dụ han-quoc. |
year |
number | Không | Lọc theo năm phát hành, ví dụ 2024. |
sort_field |
string | Không | modified.time | _id | year (mặc định modified.time). |
sort_type |
string | Không | desc | asc (mặc định desc). |
sort_lang |
string | Không | vietsub | thuyet-minh | long-tieng. |
{
"status": true,
"msg": "done",
"data": {
"items": [
{
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"type": "hoathinh",
"thumb_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"poster_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"sub_docquyen": false,
"chieurap": true,
"time": "105 phút",
"episode_current": "Full",
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"year": 2022,
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"last_episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"name": "Full"
}
]
}
],
"params": {
"type_slug": "nam",
"slug": "2022",
"filterCategory": [
""
],
"filterCountry": [
""
],
"filterYear": "2022",
"filterType": "",
"sortField": "modified.time",
"sortType": "desc",
"pagination": {
"totalItems": 7,
"totalItemsPerPage": 24,
"currentPage": 1,
"pageRanges": 5
}
}
}
}
https://phimapi.com/v1/api/nam/2024?category=hoat-hinh
Tìm kiếm phim
Tìm phim theo từ khóa; khớp cả tên tiếng Việt và tên gốc. Hỗ trợ bộ lọc chung và limit.
curl --request GET \ --url 'https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10' \ --header 'accept: application/json'
const res = await fetch('https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10', {
headers: { accept: 'application/json' }
});
const data = await res.json();
console.log(data);
fetch('https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10')
.then(r => r.json())
.then(data => console.log(data));
$ch = curl_init('https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['accept: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
resp = requests.get(
'https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10',
headers={'accept': 'application/json'},
)
print(resp.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10"))
.header("accept", "application/json")
.GET().build();
HttpResponse<String> res =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require 'net/http'
require 'json'
uri = URI('https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10')
res = Net::HTTP.get(uri)
puts JSON.parse(res)
let url = URL(string: "https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10")!
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}
task.resume()
Tìm phim theo từ khóa; khớp cả tên tiếng Việt và tên gốc. Hỗ trợ bộ lọc chung và limit.
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
keyword |
string | Có | Từ khóa tìm kiếm. |
limit |
integer | Không | Số phim mỗi trang (mặc định 10). |
page |
integer | Không | Trang hiện tại (mặc định 1). |
category |
slug | Không | Lọc theo thể loại, ví dụ hanh-dong. |
country |
slug | Không | Lọc theo quốc gia, ví dụ han-quoc. |
year |
number | Không | Lọc theo năm phát hành, ví dụ 2024. |
sort_field |
string | Không | modified.time | _id | year (mặc định modified.time). |
sort_type |
string | Không | desc | asc (mặc định desc). |
sort_lang |
string | Không | vietsub | thuyet-minh | long-tieng. |
{
"status": "success",
"message": "",
"data": {
"items": [
{
"tmdb": {
"id": "718789",
"type": "movie",
"season": null,
"vote_average": 6.887,
"vote_count": 3703
},
"imdb": {
"id": null,
"vote_average": 0,
"vote_count": 0
},
"modified": {
"time": "2026-01-23T09:07:25.000Z"
},
"_id": "54229abfcfa5649e7003b83dd4755294",
"name": "Lightyear: Cảnh Sát Vũ Trụ",
"slug": "lightyear-canh-sat-vu-tru",
"origin_name": "Lightyear",
"alternative_names": [],
"type": "hoathinh",
"thumb_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"poster_url": "c34d0de9b0d8383ae31ac2d13e74a924.jpg",
"sub_docquyen": false,
"chieurap": true,
"time": "105 phút",
"episode_current": "Full",
"quality": "FHD",
"lang": "Vietsub + Lồng Tiếng",
"lang_key": [
"vs"
],
"year": 2022,
"category": [
{
"name": "Khoa Học",
"slug": "khoa-hoc",
"id": "6a4927308e6c3c87500b802e"
}
],
"country": [
{
"name": "Âu Mỹ",
"slug": "au-my",
"id": "6a4927308e6c3c87500b8006"
}
],
"last_episodes": [
{
"server_name": "Vietsub",
"is_ai": false,
"name": "Full"
}
]
}
],
"params": {
"type_slug": "tim-kiem",
"keyword": "canh",
"filterCategory": [
""
],
"filterCountry": [
""
],
"filterYear": "",
"filterType": "",
"sortField": "modified.time",
"sortType": "desc",
"includeUnpublished": false,
"pagination": {
"totalItems": 6,
"totalItemsPerPage": 24,
"currentPage": 1,
"pageRanges": 5
}
}
}
}
https://phimapi.com/v1/api/tim-kiem?keyword=avengers&limit=10