Automate your Webp conversion workflow

Explorez la documentation de notre API et des exemples pour intérergrer Png2Webp dans votre appliction ou flux de travail.

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

Le dépassement des limites tarifaires entraîne une réponse HTTP status 429 (aucun crédit facturé). Les clients peuvent utiliser les en-têtes de réponse suivants pour gérer gracieusement les limites de débit :

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:

Cette section vous a-t-elle été utile?YesNon
Last update: a month ago

Cookies

Nous utilisons des cookies pour améliorer votre expérience et à des fins d'analyse. Vous pouvez les désactiver à tout moment.