ForHosting KIT · Video

Read a video's metadata

Before you transcode, route, bill, or reject a video file, you need to know what it actually is: how long it runs, what codec it's wrapped in, at what resolution and bitrate. This endpoint reads the container and streams and hands that back as structured data, so no script of yours has to guess.

● StablePer request + per video$0.077
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The problem of not knowing what you received

A video upload can claim to be anything: the wrong container, a resolution that doesn't match the filename, a variable bitrate that only shows up mid-file, an audio track encoded in a codec your player doesn't support. The video metadata api exists for the systems that have to make a decision the moment a file lands, whether that decision is 'transcode this' or 'reject this' or 'route this to the right queue,' without a person ever opening the file to look.

What a call returns

POST /video/metadata takes a link to the file and, once processed, hands back duration, container format, video codec and audio codec, resolution, frame rate, bitrate for each stream, and basic stream count, all as clean structured JSON, no scraping of a text dump or parsing a command-line tool's console output required.

How the request flow works

Like every task on the platform, this one is asynchronous: you get a task_id the moment you submit, the file is inspected in the background, and the result reaches you as a signed webhook call the moment it's ready, or as a signed link you fetch yourself, valid for 24 hours before it expires along with the source copy.

A little context on why metadata is messy

Video containers such as MP4 or MKV are wrappers that can hold streams encoded in dozens of different codecs, each with its own way of storing duration and bitrate, and some files are muxed by tools that write inconsistent or missing header fields; a proper metadata read has to actually probe the streams rather than trust the container header blindly, which is exactly the work this endpoint does for you.

Where it belongs in automation

Because the result is structured and predictable, it's built to sit in front of other steps: a transcoding pipeline that only converts files above a certain bitrate, an upload gate that rejects anything longer than a set duration, or a catalog system that needs accurate resolution and codec fields for every asset without a human ever opening the file.

Upload validation gate

A platform checks resolution and duration on every upload before accepting it, rejecting files that don't meet minimum quality standards without downloading the whole thing first.

Smart transcoding routing

A media pipeline reads codec and bitrate to decide whether a file needs re-encoding or can be served as-is, saving unnecessary transcode jobs.

Storage and billing audits

A hosting service periodically pulls metadata across its library to calculate accurate storage costs based on real bitrate and duration rather than file size estimates.

Compatibility checks before playback

An app verifies a video's codec against the target device's supported formats before attempting playback, avoiding a failed stream on the user's end.

How do I get a video's metadata through the API?

Send a POST request to /video/metadata with a link to the file; you receive a task_id right away and the structured metadata later via webhook or signed link.

What fields does the video metadata api return?

Duration, container format, video and audio codecs, resolution, frame rate, bitrate and stream count, delivered as structured JSON.

Is metadata extraction free to try?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

Does it work with any video format?

It reads the common containers and codecs used in production video, such as MP4, MOV, MKV, WebM and their standard audio/video codec combinations.

How much does a metadata request cost?

It's $0.077 per request plus $0.0045 per video, published openly with no invented credit units.

Do I get charged if the file can't be read?

No, a failed task is retried up to three times and never billed if it ultimately fails; you get a clear error instead.

Can I use this to bulk-audit a large video library?

Yes, since each request is billed individually and processed asynchronously, it scales naturally to scripted batch runs across a whole catalog.

Is the endpoint available now?

It's in final deployment and not yet live for jobs, with availability expected very soon under the pricing and endpoint described here.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/video/metadata

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/video/metadata \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "video.metadata",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.077
Per video$0.0045

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb500
max_minutes60
max_megapixels3.9
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →