What the API covers

The interface mirrors what you can do in the dashboard. You can read account details and storage, request an upload server and send a file, import a video from a URL, list and inspect files, move and rename them, create folders, search videos and manage the remote upload queue. A few extras let you attach a splash image or subtitles from a remote address.

Requests are plain HTTP GET or POST. Your API key goes in a key parameter and is found in your account settings. Every reply is JSON with a message, a status code, a server time and a result. A response status of 429 means you hit the limit of 10 requests per second; contact support if you need more.

Typical integrations

Publishing workflows that push a rendered video straight from a build server, content tools that import a link from a spreadsheet, plugins that list a creator library on a site, and monitoring scripts that watch encoding status. The official PHP and Python clients are listed as coming soon, so for now you call the endpoints directly as shown below.

Endpoint groups

A summary of the documented methods.

Account

Read profile, balance and storage, pull reporting stats for a date range and list DMCA notices.

Upload

Ask for an upload server, then post the file as multipart form data and get codes and links back.

Remote upload

Add a URL, list jobs, check status and slots, and restart or clear failed imports.

Папки

Create, rename and list folders and the files inside them.

Файлы

List, check, inspect, rename, move and clone files and fetch their thumbnails.

Search

Find videos by search term and attach splash images or subtitles from URLs.

Make your first call

  1. 1Sign in and copy your API key from the account settings page.
  2. 2Call the account info endpoint to confirm the key works and to see your storage and balance.
  3. 3Request an upload server with the upload server endpoint and note the address it returns.
  4. 4Post the file to that address as multipart form data. The reply includes the file code, a watch link and an embed link.
  5. 5Poll the file check endpoint, or list files, to see when processing finishes.

Examples with real endpoints

curl: account info and upload

The first call checks the key. The second posts a file to the server address returned by the upload server call.

curl "https://filehost.net/api/account/info?key=YOUR_API_KEY"

curl "https://filehost.net/api/upload/server?key=YOUR_API_KEY"

curl -X POST -F 'api_key=YOUR_API_KEY' -F '[email protected]' \
  "https://filehost.net/api/upload/server/01?key=YOUR_API_KEY"

PHP: import a video from a URL

Adds a remote upload job and prints the file code. Use urlencode on the source address.

<?php
$key = 'YOUR_API_KEY';
$src = urlencode('https://example.com/video.mp4');
$res = json_decode(file_get_contents(
    "https://filehost.net/api/upload/url?key=$key&url=$src"
), true);
echo $res['result']['filecode'] ?? 'failed';

JavaScript: check a file status

Works in Node 18 or later and in a browser, as long as you keep the key on the server side.

const key = process.env.FILEHOST_KEY;
const code = 'FILE_CODE';
const r = await fetch(
  `https://filehost.net/api/file/check?key=${key}&file_code=${code}`
);
const data = await r.json();
console.log(data.result[0].status);

Good practice

Keep the key out of client-side code, because anyone who sees it can act as your account. Respect the 10 requests per second limit by queuing calls and backing off on a 429 reply. Store the file code returned by an upload, since every other call refers to a file by that code.

Large uploads are best sent from a server with a stable connection. For files that already exist online, prefer the URL import, which uses the server connection and returns immediately with a job code.

Error handling in practice

Check both the HTTP status and the status field inside the JSON body, and log the message text, which usually explains what went wrong. Treat a missing file code or an expired key as a hard failure, and a 429 reply as a signal to wait and retry. When you build batch jobs, keep a local record of every file code returned so that a crashed script can resume without uploading anything twice.

What the API does not do

There is no webhook callback documented, so completion is checked by polling. The documented upload response gives the file code and links, and the official client libraries are not yet published. If you need a capability that is missing, tell support through the contact page.

FileHost.net в сравнении

Evaluating hosts for an integration? Compare what each one exposes.

Все сравнения

Инструменты и руководства

Хотите попробовать?

Create an account, copy your key and run the first curl command. You will have a working integration the same afternoon.

Частые вопросы

Yes. Every request uses your personal key, which you can copy from your account settings.

Ten requests per second. Exceeding it returns a 429 Too Many Requests reply.

Yes. Request an upload server address, then post the file to it as multipart form data.

Yes. The upload URL endpoint takes a link and returns a file code, with optional folder and title parameters.

PHP and Python clients are listed as coming soon. For now, call the HTTP endpoints directly.