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.
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.
A summary of the documented methods.
Read profile, balance and storage, pull reporting stats for a date range and list DMCA notices.
Ask for an upload server, then post the file as multipart form data and get codes and links back.
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.
Find videos by search term and attach splash images or subtitles from URLs.
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"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';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);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.
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.
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.
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.