API 文档

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

速率限制

API 请求限制为每秒 10 次,如需更多请求请联系我们

响应
{"msg":"Too Many Requests","status":"429"}

账号

账户信息

获取账户基本信息

GET https://filehost.net/api/account/info?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
响应
{
  "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
  }
}

账户报表

获取账户报表(默认最近 7 天)

GET https://filehost.net/api/account/stats?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
last
最近 x 天报表
否
from_date
起始日期 - YYYY-MM-DD
否
to_date
截止日期 - YYYY-MM-DD
否
响应
{
  "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"
    }
  ]
}

DMCA 列表

获取 DMCA 举报文件列表(每页 500 条)

GET https://filehost.net/api/dmca/list?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
per_page
每页结果数(默认 500)
否
page
分页
否
响应
{
  "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"
    }
  ]
}

上传

本地上传

通过 API 上传本地文件

GET https://filehost.net/api/upload/server?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "https://filehost.net/api/upload/server/01?key={your_api_key}"
}
使用示例(cURL)
curl -X POST -F 'api_key={your_api_key}' -F '[email protected]' "https://filehost.net/api/upload/server/01?key={your_api_key}"
使用示例(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>
上传后的响应
{
  "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"
    }
  ]
}

复制或克隆

复制 / 克隆你或他人的文件

GET https://filehost.net/api/file/clone?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件代码
是
fld_id
文件夹 ID(复制到该文件夹内)
否
响应
{
  "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"
  }
}

大文件(可续传上传)

大文件请分片发送。失败的分片只需重新发送;中断的上传在你使用相同的名称、大小和修改时间重新开始时(48 小时内)会从中断处继续。

POST https://filehost.net/api/uploads/chunked?key={your_api_key}
参数
说明
必填
name
含扩展名的文件名
是
size
文件大小(字节)
是
modified
最后修改时间(对该文件保持不变的任意数字)
否
folder_id
文件夹 ID
否
响应
{
  "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]
}
然后发送 missing 中列出的每个分片,最后完成
# 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}"
上传后的响应
{
  "status": "ok",
  "kind": "video",
  "code": "xxx"
}

远程上传

添加链接

通过直链上传文件

GET https://filehost.net/api/upload/url?key={your_api_key}&url={upload_url}
参数
说明
必填
key
你的 API 密钥
是
url
上传 URL
是
fld_id
上传到文件夹内
否
new_title
设置新标题
否
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "new_title": "",
  "status": 200,
  "total_slots": "100",
  "result": {
    "filecode": "98zukoh5jqiw"
  },
  "used_slots": "0"
}

远程上传列表

远程上传列表与状态

GET https://filehost.net/api/urlupload/list?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
响应
{
  "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"
    }
  ]
}

远程上传状态

远程上传状态

GET https://filehost.net/api/urlupload/status?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件的文件代码
是
响应
{
  "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"
    }
  ]
}

远程上传名额

获取远程上传名额总数与已用数

GET https://filehost.net/api/urlupload/slots?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "total_slots": "100",
  "used_slots": "10"
}

远程上传操作

对远程上传执行各种操作

GET https://filehost.net/api/urlupload/actions?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
restart_errors
重试所有错误
是
clear_errors
清除所有错误
否
clear_all
全部清除
否
delete_code
删除传输任务,传入 file_code
否
响应
{
  "msg": "Errors restarted",
  "server_time": "2026-03-12 04:30:07",
  "status": 200
}

管理文件夹

创建文件夹

创建文件夹

GET https://filehost.net/api/folder/create?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
name
文件夹名称
是
parent_id
父文件夹 ID
否
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": {
    "fld_id": "1234567"
  }
}

重命名文件夹

列出所有文件夹

GET https://filehost.net/api/folder/rename?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
fld_id
文件夹 ID
是
name
文件夹的新名称
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

文件夹和文件列表

列出所有文件夹

GET https://filehost.net/api/folder/list?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
fld_id
文件夹 ID
是
only_folders
仅列出文件夹(0 或 1)
否
响应
{
    "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"
}


管理文件

文件列表

列出所有文件

GET https://filehost.net/api/file/list?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
page
分页
否
per_page
每页最多视频数(最大 200)
否
fld_id
文件夹内的视频
否
created
Show files uploaded after timestamp (Ex : 2026-03-12 03:15:19)
Or specify number to show only files uploaded X minutes ago
否
响应
{
  "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
  }
}

文件状态

查看文件状态

GET https://filehost.net/api/file/check?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件代码
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": [
    {
      "status": "Active",
      "filecode": "xxx"
    }
  ]
}

文件信息

获取文件信息

GET https://filehost.net/api/file/info?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件代码
是
响应
{
  "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"
    }
  ]
}

文件图片

获取文件封面、单张图或缩略图

GET https://filehost.net/api/file/image?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件代码
是
响应
{
  "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"
    }
  ]
}

重命名文件

重命名文件

GET https://filehost.net/api/file/rename?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件代码
是
title
新文件名
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

移动文件

将文件从一个文件夹移到另一个

GET https://filehost.net/api/file/move?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
file_code
文件代码
是
fld_id
移动到的文件夹 ID(设为 0 即根目录)
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

搜索你的文件

GET https://filehost.net/api/search/videos?key={your_api_key}
参数
说明
必填
key
你的 API 密钥
是
search_term
搜索词
是
响应
{
  "msg": "OK",
  "server_time": "2026-03-12 04:30:07",
  "status": 200,
  "result": "true"
}

更多

远程封面图

通过 URL 直接加载封面图

URL https://filehost.net/e/xxx?c_poster=https://example.com/image.jpg
参数
说明
必填
c_poster
封面图
是

远程字幕

通过 URL 直接加载多个字幕

URL https://filehost.net/e/xxx?c1_file=https://example.com/sub.vtt&c1_label=English
参数
说明
必填
c1_file
字幕 URL(srt 或 vtt)
是
c1_label
字幕语言或任意标签
是

远程字幕 JSON

通过 JSON 格式的 URL 加载多个字幕

URL https://filehost.net/e/xxx?subtitle_json=https://example.com/sub.json
参数
说明
必填
subtitle_json
JSON 格式的多个字幕
是
远程字幕 JSON 示例
[
 {"src":"https://example.com/name_en.vtt", "label":"English", default: true},
 {"src":"https://example.com/name_fr.vtt", "label":"French"}
]

官方客户端

官方 PHP 客户端

即将推出。

官方 Python 客户端

即将推出。

联系方式

如需 API 访问和集成支持,请联系 [email protected]。