Automate your Webp conversion workflow

Explore our API documentation and examples to integrate Png2Webp into your application or workflow.

Easy to integrate

Our API is a simple HTTP interface with various options:

Source images:

Direct uploads or URL reference

Result images:

Image file or JSON-encoded data

Output resolution:

up to 25 megapixels

Output resolution:

Not a developer? There are plenty ready to use tools & Apps by png2webp and our community.

illustration of a request to the api of png2web

Get started

Our API is a simple HTTP interface with various options:

You’re going to receive 100 API calls for free.

After that your first 5 API calls per day are on us (see pricing)

Use the following code samples to get started quickly

Review the reference docs to adjust any parameters

Want to know more about subscription? see pricing

illustration of a request to the api of png2web

Sample Code

$ curl -H 'X-API-Key: INSERT_YOUR_API_KEY_HERE'           \
-F 'image_file=@/path/to/file.jpg' \
-F 'size=auto' \
-f https://api.png2webp.com/v1.0/convert -o webp-file.webp

Libraries

Get up and running faster with official and third-party libraries.

Not a developer?

There are plenty ready to use tools & Apps by png2webp and our community.

Commandline Tool
Official

by Png2Webp

Ruby Gem
Official

by Png2Webp

PHP/Laravel Library

by Manuel Njiakim

Python: png2webp

by Manuel Njiakim

There are plenty ready to use tools & Apps by png2webp and our community.

Input Formats

We only accept images with the format bellow :

FormatsLimited sizeExample
PNGUp to 25 Megapixels
JPGUp to 25 Megapixels
ZIPUp to 50 Megapixels

How to use the ZIP format

This feature is not yet available in stable version. If you need this feature, get in touch

OAuth 2.0

If you want to authenticate users with the click of a button instead of having them enter an API Key, get in touch to try our OAuth 2.0 login.

API Reference

Input Formats

Input imageMegapixelsEffective Rate Limit
625 x 4001 MP 500 images per minute
1200 x 8001 MP 500 images per minute
1600 x 12002 MP 500 / 2 = 250 images per minute
2500 x 16004 MP 500 / 4 = 125 images per minute
4000 x 250010 MP 500 / 10 = 50 images per minute
6250 x 400025 MP 500 / 25 = 20 images per minute

Exceedance of rate limits leads to a HTTP status 429 response (no credits charged). Clients can use the following response headers to gracefully handle rate limits:

Response headerSample valueDescription
X-RateLimit-Limit500 MPTotal rate limit in megapixel images
X-RateLimit-Remaining499 MPRemaining rate limit for this minute
X-RateLimit-Reset1662309450 MPUnix timestamp when rate limit will reset
Retry-After59 MPSeconds until rate limit will reset (only present if rate limit exceeded)

Higher Rate Limits are available upon request

Exponential backoff

Exponential backoff is an error handling strategy in which a client periodically retries a failed request.

API Changelog

Most recent API updates:

Was this section helpful?YesNo
Last update: a month ago

Cookies

We use cookies to improve your experience and for analysis. You can deactivate them anytime.