DOCIFY HOSTED API / NO API KEY

Free Image Optimization API

Resize images to fit a bounding box, adjust output quality, or convert between PNG, JPEG and WebP from a script. Send the image bytes directly and save the returned file. The hosted service accepts images up to 20 MB.

Endpoint

POST https://docify.site/api/v1/images

Request Content-Type: image/png, image/jpeg or image/webp
Successful response: image/webp, image/jpeg or image/png, returned as a file attachment.

Try it with cURL

Run this from the folder containing your input file, where applicable. The examples use a POSIX shell. Windows PowerShell users can use curl.exe and adapt line continuation and JSON quoting.

curl -X POST "https://docify.site/api/v1/images?width=1200&height=800&quality=80&format=webp" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png \
  --output photo.webp

Query parameters

OptionAccepted values and behavior
widthMaximum output width, from 1 to 8192 pixels. Default is 1920.
heightMaximum output height, from 1 to 8192 pixels. Default is 1080.
qualityInteger from 10 to 100. Default is 80. PNG output ignores this option.
formatwebp (default), jpeg or png.

Use it from a Node.js script

This example uses Node.js 20+ with built-in fetch. Save it as an .mjs file and run it with Node. Check the response status before saving the response as a file.

import { readFile, writeFile } from "node:fs/promises";

const response = await fetch(
  "https://docify.site/api/v1/images?width=1200&height=800&quality=80&format=webp",
  {
    method: "POST",
    headers: { "Content-Type": "image/png" },
    body: await readFile("photo.png"),
  },
);
if (!response.ok) throw new Error(await response.text());
await writeFile("photo.webp", Buffer.from(await response.arrayBuffer()));

Input rules and limitations

  • Send raw binary data with the Content-Type that matches the input. Do not send a multipart form, a JSON object or a base64 string.
  • Width and height are bounds: resizing preserves proportions, does not crop, and does not enlarge the original image.
  • PNG is lossless. A quality value does not reduce PNG quality. JPEG replaces transparent areas with white, and metadata is stripped from optimized output.
  • Animated input is rejected. The output is not guaranteed to be smaller than the original: compare sizes and choose dimensions, quality and format for your content.

Errors, rate limits and data handling

The public service needs no API key and permits up to 30 requests per minute per IP. It can also return 503 when processing capacity is full. For 429, respect the Retry-After response header. Use a bounded retry delay for temporary capacity errors.

Failures return JSON with an error field. Check 400 for invalid options, 413 for an oversized request, and 415 or 422 for unsupported or invalid input. A 500 response indicates a processing failure. Repeated retries may not solve a bad template or renderer problem.

Submitted documents and images are processed for the response and are not retained as uploaded files. Use these examples in server-side scripts: browser calls from unrelated origins are restricted by the service's CORS policy.

Try the browser tool

Prefer a visual interface before writing a script?

Try the image compressor, resizer and converter →