Tài liệu API

Tài liệu API


FileHost.net provides a simple HTTP API to integrate ours into your business or application.
All requests to the API should be only GET or POST
You can find your API key here - https://filehost.net/settings

Giới hạn tốc độ

Yêu cầu API giới hạn 10 mỗi giây - cần thêm, vui lòng liên hệ chúng tôi

Phản hồi
{"msg":"Too Many Requests","status":"429"}

Tài khoản

Hồ sơ tài khoản

Lấy thông tin cơ bản của tài khoản

GET https://filehost.net/api/account/info?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": {
      "email": "[email protected]",
      "balance": "0.00000",
      "storage_used" :"24186265",
      "storage_left": 128824832615,
      "premim_expire": "2026-03-12 21:00:00
  }
}

Báo cáo tài khoản

Lấy báo cáo tài khoản (mặc định 7 ngày qua)

GET https://filehost.net/api/account/stats?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
last
Báo cáo x ngày qua
Không
from_date
Từ ngày - YYYY-MM-DD
Không
to_date
Đến ngày - YYYY-MM-DD
Không
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "profit_views": "0.00000",
      "downloads": "0",
      "views": "0",
      "day": "2026-03-12",
      "profit_total": "0.00000"
    },
    {
      "profit_views": "0.00000",
      "downloads": "0",
      "views": "0",
      "day": "2026-03-12",
      "profit_total": "0.00000"
    }
  ]
}

Các vụ DMCA

Lấy danh sách tệp bị báo cáo DMCA (500 kết quả mỗi trang)

GET https://filehost.net/api/dmca/list?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
per_page
Số kết quả mỗi trang (mặc định 500)
không
page
Phân trang
không
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "reported_on": "2026-03-12 04:30:07",
      "protected_download": "yyy",
      "protected_embed": "zzz",
      "file_code": "xxx",
      "fld_id": "0",
      "disabled_on": "2026-03-12 05:00:07"
    }
  ]
}

Tải lên

Tải lên từ máy

Tải tệp cục bộ lên bằng API

GET https://filehost.net/api/upload/server?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "https://filehost.net/api/upload/server/01?key={your_api_key}"
}
Ví dụ sử dụng (cURL)
curl -X POST -F 'api_key={your_api_key}' -F '[email protected]' "https://filehost.net/api/upload/server/01?key={your_api_key}"
Ví dụ sử dụng (HTML)
<form enctype="multipart/form-data" action="https://filehost.net/api/upload/server/01?key={your_api_key}" method="post">
<input type="hidden" name="api_key" value="{your_api_key}">
<input name="file" type="file">
<input type="submit">
</form>
Phản hồi sau khi tải lên
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "download_url": "https://filehost.net/d/xxx",
      "single_img": "../assets/img/examples/snaps/xxx.jpg",
      "status": 200,
      "filecode": "xxx",
      "splash_img": "../assets/img/examples/splash/xxx.jpg",
      "canplay": 1,
      "size": "123456",
      "length": "123456",
      "uploaded": "2026-03-12 04:30:07",
      "protected_embed": "https://filehost.net/e/yyy",
      "protected_dl": "https://filehost.net/d/zzz",
      "title": "test_file"
    }
  ]
}

Sao chép/Nhân bản

Sao chép / Nhân bản tệp của bạn hoặc người khác

GET https://filehost.net/api/file/clone?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp
Có
fld_id
ID thư mục (để sao chép vào thư mục)
Không
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": {
    "embed_url": "https://filehost.net/e/xxx",
    "download_url": "https://filehost.net/d/xxx",
    "protected_download": "https://filehost.net/d/yyy",
    "protected_embed": "https://filehost.net/e/zzz",
    "filecode": "xxx"
  }
}

Tệp lớn (tải lên có thể tiếp tục)

Hãy gửi tệp lớn theo từng phần. Phần bị lỗi sẽ được gửi lại, và lượt tải lên bị gián đoạn sẽ tiếp tục từ chỗ dừng khi bạn bắt đầu lại với cùng tên, kích thước và thời gian sửa đổi (trong vòng 48 giờ).

POST https://filehost.net/api/uploads/chunked?key={your_api_key}
Tham số
Mô tả
Bắt buộc
name
Tên tệp kèm phần mở rộng
Có
size
Kích thước tệp (byte)
Có
modified
Thời gian sửa đổi cuối (số bất kỳ không đổi với mỗi tệp)
Không
folder_id
ID thư mục
Không
Phản hồi
{
  "status": "ok",
  "upload_id": "up_8fe75a942bd003f06095",
  "chunk_bytes": 8388608,
  "chunk_count": 13,
  "missing": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
}
Sau đó gửi mọi phần có trong missing, rồi hoàn tất
# part N = bytes N*chunk_bytes up to (N+1)*chunk_bytes, as the raw request body
curl -X POST --data-binary @part-0.bin -H "Content-Type: application/octet-stream" \
  "https://filehost.net/api/uploads/chunked/{upload_id}/0?key={your_api_key}"

curl -X POST "https://filehost.net/api/uploads/chunked/{upload_id}/complete?key={your_api_key}"
Phản hồi sau khi tải lên
{
  "status": "ok",
  "kind": "video",
  "code": "xxx"
}

Tải lên từ xa

Thêm link

Tải tệp lên bằng liên kết trực tiếp

GET https://filehost.net/api/upload/url?key={your_api_key}&url={upload_url}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
url
URL cần tải lên
Có
fld_id
Để tải lên trong một thư mục
Không
new_title
Để đặt tiêu đề mới
Không
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "new_title": "",
  "status": 200,
  "total_slots": "100",
  "result": {
    "filecode": "98zukoh5jqiw"
  },
  "used_slots": "0"
}

Danh sách tải lên từ xa

Danh sách và trạng thái tải lên từ xa

GET https://filehost.net/api/urlupload/list?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "bytes_total": "0",
      "created": "2026-03-12 04:30:07",
      "remote_url": "https://dropbox.com/hukbasd7k3fd",
      "status": "working",
      "file_code": "98zukoh5jqiw",
      "bytes_downloaded": "0",
      "folder_id": "0"
    }
  ]
}

Trạng thái tải lên từ xa

Trạng thái tải lên từ xa

GET https://filehost.net/api/urlupload/status?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp của tệp
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "bytes_total": "0",
      "created": "2026-03-12 04:30:07",
      "remote_url": "https://dropbox.com/hukbasd7k3fd",
      "status": "working",
      "file_code": "hjsnr087johj",
      "bytes_downloaded": "0",
      "folder_id": "0"
    }
  ]
}

Slot tải lên từ xa

Lấy tổng số và số slot tải lên từ xa đã dùng

GET https://filehost.net/api/urlupload/slots?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "total_slots": "100",
  "used_slots": "10"
}

Thao tác tải lên từ xa

Thực hiện nhiều thao tác với tải lên từ xa

GET https://filehost.net/api/urlupload/actions?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
restart_errors
Chạy lại mọi lỗi
Có
clear_errors
Xóa tất cả lỗi
Không
clear_all
Xóa tất cả
Không
delete_code
Xóa một lượt chuyển, truyền file_code
Không
Phản hồi
{
  "msg": "Errors restarted",
  "server_time": "2026-03-12 04:30:07",
  "status": 200
}

Quản lý thư mục

Tạo thư mục

Tạo thư mục

GET https://filehost.net/api/folder/create?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
name
Tên thư mục
Có
parent_id
ID thư mục cha
Không
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": {
    "fld_id": "1234567"
  }
}

Đổi tên thư mục

Liệt kê mọi thư mục

GET https://filehost.net/api/folder/rename?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
fld_id
ID thư mục
Có
name
Tên mới của thư mục
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

Liệt kê thư mục và tệp

Liệt kê mọi thư mục

GET https://filehost.net/api/folder/list?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
fld_id
ID thư mục
Có
only_folders
Chỉ liệt kê thư mục (0 hoặc 1)
Không
Phản hồi
{
    "msg":"OK",
    "status":200,
    "result":{
        "folders":[
            {
            "name":"Folder name",
            "code":"67299gduj3",
            "fld_id":"123"
            },
        ],
        "files": [
              {
                "download_url": "https://filehost.net/d/xxx",
                "single_img": "../assets/img/examples/snaps/xxx.jpg",
                "file_code": "xxx",
                "canplay": 1,
                "length": "1234",
                "views": "1",
                "uploaded": "2026-03-12 04:30:07",
                "public": "1",
                "fld_id": "0",
                "title": "test_file"
              }
            ],
    },
        "server_time":"2026-03-12 07:31:01"
}


Quản lý tệp

Liệt kê tệp

Liệt kê mọi tệp

GET https://filehost.net/api/file/list?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
page
Phân trang
không
per_page
Số video tối đa mỗi trang (tối đa 200)
không
fld_id
Video trong thư mục
không
created
Show files uploaded after timestamp (Ex : 2026-03-12 03:15:19)
Or specify number to show only files uploaded X minutes ago
không
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": {
    "total_pages": 1,
    "files": [
      {
        "download_url": "https://filehost.net/d/xxx",
        "single_img": "../assets/img/examples/snaps/xxx.jpg",
        "file_code": "xxx",
        "canplay": 1,
        "length": "1234",
        "views": "1",
        "uploaded": "2026-03-12 04:30:07",
        "public": "1",
        "fld_id": "0",
        "title": "test_file"
      }
    ],
    "results_total": "1",
    "results": 1
  }
}

Trạng thái tệp

Kiểm tra trạng thái tệp của bạn

GET https://filehost.net/api/file/check?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "status": "Active",
      "filecode": "xxx"
    }
  ]
}

Thông tin tệp

Lấy thông tin tệp

GET https://filehost.net/api/file/info?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "single_img": "../assets/img/examples/snaps/xxx.jpg",
      "status": 200,
      "filecode": "xxx",
      "splash_img": "../assets/img/examples/splash/xxx.jpg",
      "canplay": 1,
      "size": "123456",
      "views": "0",
      "length": "123456",
      "uploaded": "2026-03-12 04:30:07",
      "last_view": "",
      "protected_embed": "/e/yyy",
      "protected_dl": "/d/zzz",
      "title": "test_file"
    }
  ]
}

Ảnh của tệp

Lấy ảnh bìa, ảnh đơn hoặc ảnh thu nhỏ của tệp

GET https://filehost.net/api/file/image?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "status": 200,
      "filecode": "xxx",
      "title": "test_file",
      "single_img": "../assets/img/examples/snaps/xxx.jpg",
      "thumb_img": "../assets/img/examples/thumbnails/xxx.jpg",
      "splash_img": "../assets/img/examples/splash/xxx.jpg"
    }
  ]
}

Đổi tên tệp

Đổi tên tệp của bạn

GET https://filehost.net/api/file/rename?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp
Có
title
Tên tệp mới
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

Di chuyển tệp

Chuyển tệp từ thư mục này sang thư mục khác

GET https://filehost.net/api/file/move?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
file_code
Mã tệp
Có
fld_id
ID thư mục để chuyển tệp tới (đặt 0 cho thư mục gốc)
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

Tìm tệp của bạn

GET https://filehost.net/api/search/videos?key={your_api_key}
Tham số
Mô tả
Bắt buộc
key
Khóa API của bạn
Có
search_term
Từ khóa tìm
Có
Phản hồi
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

Bổ sung

Ảnh bìa từ xa

Tải ảnh bìa trực tiếp qua URL

URL https://filehost.net/e/xxx?c_poster=https://example.com/image.jpg
Tham số
Mô tả
Bắt buộc
c_poster
Ảnh bìa
Có

Phụ đề từ xa

Tải nhiều phụ đề trực tiếp qua URL

URL https://filehost.net/e/xxx?c1_file=https://example.com/sub.vtt&c1_label=English
Tham số
Mô tả
Bắt buộc
c1_file
URL phụ đề (srt hoặc vtt)
Có
c1_label
Ngôn ngữ phụ đề hoặc nhãn bất kỳ
Có

JSON phụ đề từ xa

Tải nhiều phụ đề qua URL ở định dạng JSON

URL https://filehost.net/e/xxx?subtitle_json=https://example.com/sub.json
Tham số
Mô tả
Bắt buộc
subtitle_json
Nhiều phụ đề ở định dạng JSON
Có
Ví dụ JSON phụ đề từ xa
[
 {"src":"https://example.com/name_en.vtt", "label":"English", default: true},
 {"src":"https://example.com/name_fr.vtt", "label":"French"}
]

Ứng dụng chính thức

Thư viện PHP chính thức

Sắp ra mắt.

Thư viện Python chính thức

Sắp ra mắt.

Liên hệ

Để được hỗ trợ truy cập và tích hợp API, hãy liên hệ [email protected].