Image Convert API — AVIF, WebP, JPG & PNG avatar

Image Convert API — AVIF, WebP, JPG & PNG

Pricing

from $3.00 / 1,000 image standard 1units

Go to Apify Store
Image Convert API — AVIF, WebP, JPG & PNG

Image Convert API — AVIF, WebP, JPG & PNG

Convert, resize and optimize static AVIF, WebP, JPEG and PNG images in batches.

Pricing

from $3.00 / 1,000 image standard 1units

Rating

0.0

(0)

Developer

Ezra Evercreech

Ezra Evercreech

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

Image Convert API

Convert static JPEG, PNG, WebP and AVIF images in batches. Resize without distortion or enlargement, apply EXIF orientation, and choose a background for transparent images converted to JPEG.

Input

{
"urls": ["https://raw.githubusercontent.com/heavyrain39/webplified/main/banner.webp"],
"options": { "format": "avif", "quality": 80, "width": 1280, "background": "#ffffff" }
}
OptionDefaultSupported values
formatwebpjpeg, png, webp, avif
quality80Integer 1–100; PNG ignores this option
width, heightOriginal sizeInteger 1–8192; fit inside the bounding box, preserve ratio
background#ffffff#RRGGBB; used when removing transparency for JPEG

Maximum 20 URLs per run, 20 MiB and 24 million pixels per input. Static 8-bit images only. Animated WebP/APNG, image sequences, HEIC, SVG, PDF and HDR workflows are unsupported. Output is converted to sRGB and metadata is stripped. Pixel dimensions determine processing cost even if the output is resized. Output cannot exceed 40 MiB. A conversion can increase file size; negative savings are reported honestly.

URL inputs must be publicly downloadable over HTTP(S), without cookies or authorization headers. Private/reserved IPs, nonstandard ports and unsafe redirects are rejected. Source URL parameters are not echoed into result rows. File processing is sequential, with a 30-second download deadline and 30-second image-processing timeout per file.

Results

Each Dataset row contains index, status, input/output byte counts, dimensions, output format, savings_percent, billable_units, billing_event, and the result's output_key/output_url. Failed files produce an error row and no result event charge. SUMMARY records successful, failed, budget-skipped and recovered items plus SDK charge acknowledgements. If every file fails, the run fails too.

The result URL is a shareable URL to the run's Apify key-value store. Anyone holding it may be able to retrieve the file. Its lifetime follows the store's retention settings; this service does not provide permanent hosting or a guaranteed 24-hour expiry. Download results into your own storage. Raw downloaded inputs exist only in process memory. Apify retains the submitted input JSON and output records according to platform settings.

Launch pricing (USD, platform usage included)

  • JPEG/PNG/WebP: $0.003 per image unit.
  • AVIF output: $0.006 per image unit.
  • Each run: $0.005, including runs whose files fail.

An image up to 4 megapixels and up to 8 MiB combined input/output is one unit. Larger files use:

units = max(1, ceil(input pixels / 4,000,000), ceil((input bytes + output bytes) / 8 MiB))

Each successful file costs 1–8 units and generates one corresponding billing event. For example, 20 one-unit WebP outputs cost $0.065 total; AVIF costs $0.125. The run's spending limit is checked before downloads and again after the exact file charge is known. If the next file exceeds the budget, its output is not delivered or charged and the batch stops. A download/conversion may therefore occur before a larger file is found to exceed the remaining budget.

The fixed 2 GB run uses two automatic start events at $0.0025 each, totaling $0.005. There is no separate Dataset-row charge.

Call from your application

Start an asynchronous run using your Apify token and an explicit spending limit:

curl -X POST "https://api.apify.com/v2/acts/epubpreflight~image-convert-api/runs?maxTotalChargeUsd=1" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @input.json

Save data.id from the response. Poll GET /v2/actor-runs/{runId} with the same authorization header until the run finishes. Read GET /v2/datasets/{defaultDatasetId}/items to obtain result rows and download each successful output_url.

Use only source files you have permission to process. For help, open an issue on this Actor and include the run ID, without posting confidential source URLs.