ForHosting KIT · Data & Files

Gzip

Compress a payload down with gzip, deflate or brotli, or decompress one back to its original bytes, through a single endpoint that picks up the heavy lifting your application shouldn't be doing on a request thread. It exists for the moments when you need real compression control outside the automatic layer your web server or CDN already applies.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Compression is everywhere, but rarely in your control

Most web stacks compress HTTP responses transparently, which is great for serving pages but useless the moment you need to compress a log file before archiving it, shrink a JSON export before storing it, or decompress an inbound webhook payload that arrived gzip-encoded from a third party. Those are file- and blob-level jobs, not response-level ones, and doing them inline in application code means burning CPU cycles that could be serving users instead.

Three algorithms, three trade-offs

POST /data/gzip takes an algorithm parameter — gzip, deflate or brotli — plus a direction of compress or decompress, and returns the result via task_id. Gzip is the ubiquitous choice, readable by essentially every tool since the 1990s; deflate is its raw core algorithm without the gzip wrapper, useful when a spec explicitly calls for it (like some ZIP internals or older HTTP implementations); brotli, developed and open-sourced more recently, generally compresses tighter than gzip at similar speed, which matters when you're optimizing storage costs or transfer size for large text-based payloads.

What determines the size you get back

Compression ratio depends entirely on the nature of your data: highly repetitive text like logs, CSV exports or minified JSON can shrink dramatically, while already-compressed formats such as JPEG or a previously-gzipped file will barely change size and may even grow slightly due to format overhead. The endpoint doesn't try to guess what's optimal for your content — you choose the algorithm, and the result tells you exactly what ratio you achieved.

Built for pipelines, not one-off downloads

Because every call is async with a task_id, you can fire off compression jobs from a queue worker, a scheduled export, or a webhook handler without blocking on the response, then pick up the compressed or decompressed file from a signed link or your own webhook receiver. A failed job — malformed input, an unreadable stream — costs you nothing, since we only bill successful completions after retries are exhausted.

Where this sits in a larger process

This endpoint pairs naturally with our archive and conversion tools: decompress an inbound gzip payload, hand the raw bytes to a format converter, then re-compress the output with brotli before storing it. Treat it as a utility block you drop into any pipeline that moves data between systems with different compression expectations, rather than a destination in itself.

Log archiving pipelines

Gzip rotated log files before moving them to cold storage, cutting storage costs without running compression on the application server itself.

Inbound webhook decoding

Decompress gzip-encoded payloads sent by a third-party provider before parsing the JSON or XML underneath.

Data export optimization

Brotli-compress large CSV or JSON exports before offering them as a download, shrinking transfer time for end users on slow connections.

Legacy format compatibility

Deflate-compress a payload when integrating with an older system or protocol that expects the raw algorithm without a gzip header.

How do I compress a file using the gzip API?

POST the file to /data/gzip with direction set to compress and the algorithm you want (gzip, deflate or brotli); you'll get a task_id and the compressed file arrives via webhook or a signed link.

Does it support brotli as well as gzip?

Yes, the endpoint supports gzip, deflate and brotli, selected with a single algorithm parameter in the same request.

Can I decompress a file back to its original form?

Yes, set direction to decompress and the endpoint reverses the operation, returning the original bytes.

Is there a free tier for the compression API?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

What's the cost per compression request?

$0.002 per request, whether you're compressing a 1KB file or a large export, and failed requests are never charged.

Which algorithm gives the smallest output, gzip or brotli?

Brotli generally compresses text-based data tighter than gzip at comparable speed, though the actual gain depends on your specific content.

Will compressing an already-compressed file like a JPEG shrink it further?

Not meaningfully — formats like JPEG, PNG or previously-gzipped files are already near their entropy limit, so re-compressing them adds little to no benefit.

How long do I have to download the result?

The signed result link stays valid for 24 hours; for automated pipelines, a webhook delivers the result as soon as the task finishes.

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/data/gzip

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/data/gzip \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.gzip",
  "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.002

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

max_mb25
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 →