Video Size API

Last updated: 18 September 2026 · Platform limits last verified: 2026-09-14

The short version

  • Two read-only endpoints: /api/v1/platforms and /api/v1/estimate.
  • No API key, no account, no sign-up. Nothing to authenticate because nothing is per-user.
  • Free. 600 requests per hour per IP. Nothing behind these endpoints costs us money per call, so the limit is there to stop a scraper, not to sell you a tier.
  • It answers questions about a video from its size and duration. It does not take uploads and does not compress — that is what the compressor itself is for.
  • CORS is open (*), so you can call it straight from a browser.

Why this exists

Every upload limit on the internet is written down in three places and correct in none of them. Discord raised its free cap from 10 MB to 20 MB in August 2026 and its own FAQ still said 10 MB weeks later. Gmail's “25 MB” is really about 18 MB of file, because the attachment is measured after base64 encoding. Telegram's 2 GB does not apply to bots, which stop at 50 MB.

We maintain those numbers with a verifiedAt date and a source list per platform because our own tool depends on them. This API is that table, plus the arithmetic our compressor runs before a byte is uploaded. Both are served from the same constants the pages render, so nothing here can be stale while the site is right.

GET /api/v1/platforms

Every upload ceiling we track, with sources. No parameters.

curl -s https://vidsmaller.com/api/v1/platforms

Returns 8 platforms — discord, email, whatsapp, telegram, slack, instagram, tiktok, twitter — each with:

statedLimitMbnumberWhat the platform advertises for its primary tier.
safeTargetMbnumberWhat to actually compress to. Always below statedLimitMb: a target-size encode lands within a couple of percent of its target, and two percent over a hard ceiling is a failed upload.
tierNotestring | nullThe caveat that makes the advertised number misleading, where there is one.
tiers[]arrayEvery documented tier (free, paid, bot API, per-client caps) with its own note.
verifiedAtdateWhen a human last checked this platform against its own documentation.
sources[]arrayWhere they checked, so you can cite the platform rather than citing us.

GET or POST /api/v1/estimate

Will this file upload, and if not, what should it be compressed to? Query parameters on GET, a JSON body on POST — identical fields, identical response.

curl -s "https://vidsmaller.com/api/v1/estimate?sizeMb=150.7&durationSeconds=596&platform=discord"

Parameters

sizeBytesintSource file size. Required, unless you send sizeMb.
sizeMbnumberSame thing in MB. 1 MB = 1,048,576 bytes throughout, because that is what the encoder aims at.
durationSecondsnumberOptional, and the most useful optional field by a wide margin: without a duration there is no bitrate, and without a bitrate nothing can tell you whether the target size is comfortable or brutal.
width, heightintOptional. Needed only for mode: resolution.
platformstringOptional. One of the keys from /api/v1/platforms. Sets the target and returns that platform's caveat and sources.
targetMbnumberOptional. Your own hard limit, in MB. Overrides the platform default — for a CMS or a client spec that has nothing to do with a social network.
settingsobjectOptional. The compressor settings to predict, mirroring the tool's own options: mode (preset · target_size · quality · resolution · bitrate), preset, targetSizeMb, crf, resolution, bitrateKbps, codec, outputFormat. Defaults to the Balanced preset. On GET, send these as flat query parameters.

Response

verdictstringfits_as_is · compress_recommended · no_target (no platform or targetMb was given). Safe to switch on.
estimateobject | nullPredicted output for the settings you asked about. Null when the inputs genuinely do not determine an answer — a bitrate mode with no duration, a resolution change with no source dimensions — with the reason in notes. A guess dressed as a prediction is worse than no answer.
recommendationobject | nullSettings that will fit the target, present only when the file does not already. Includes a quality block: the video bitrate that target leaves you and the highest resolution it can carry.
notes[]string[]Plain-English caveats worth surfacing to whoever reads the output — including when a target is small enough that trimming the clip beats any encoder setting.
compressUrlstringWhere a human finishes the job.
{
  "ok": true,
  "input":  { "sizeBytes": 158020403, "sizeMb": 150.7, "durationSeconds": 596 },
  "target": {
    "platform": "discord",
    "safeTargetMb": 19,
    "statedLimitMb": 20,
    "statedLimitTier": "Free",
    "tierNote": "Raised from 10 MB on 13 August 2026 …",
    "verifiedAt": "2026-09-14",
    "sources": [ { "label": "Discord — File Attachments FAQ", "url": "…" } ]
  },
  "verdict":   "compress_recommended",
  "fitsAsIs":  false,
  "estimate": {
    "settings":     { "mode": "preset", "preset": "balanced", "codec": "libx264" },
    "outputMb":     90.4,
    "savedPercent": 40,
    "fitsTarget":   false,
    "jobSeconds":   123
  },
  "recommendation": {
    "settings": { "mode": "target_size", "targetSizeMb": 19 },
    "outputMb": 19,
    "quality":  { "videoKbps": 134, "verdict": "rough", "comfortableUpTo": null }
  },
  "notes": [ "19 MB over 596s leaves about 134 kbps for video — …" ],
  "compressUrl": "https://vidsmaller.com/compress-video-for-discord#compress"
}

Accuracy

Platform limits are facts with a date and a source. Everything in estimate is an estimate, and the honest error bars are worth stating:

  • Percentage presets are what we ask the encoder for, so they are close by construction.
  • Target size is a two-pass encode aiming at your number; it lands within a couple of percent, which is exactly why safeTargetMb leaves headroom.
  • CRF is the loosest of the three. The curve is anchored at CRF 28 ≈ half the original — a property of x264, not of any preset — and real footage varies with how much motion and grain it carries.
  • Quality verdicts come from a deliberately conservative bitrate ladder, pulled about a third below YouTube's and Apple's recommended upload bitrates, because a re-encode of already-compressed footage survives lower bitrates than a clean master does. The failure we care about is telling you a video will look fine when it will not.

Fair use

  • 600 requests per hour per IP. Ask if you need more.
  • No key means no way to warn you before a breaking change, so /api/v1 is frozen: new fields may appear, existing ones will not change meaning.
  • Use it in anything, commercial included. A link back to vidsmaller.com is appreciated and not required.
  • If a platform limit here is wrong, tell us — that is the whole product. support@vidsmaller.com

Related

Video compression calculator · Discord upload limits · Terms of Service