Developer API

Connect and automate your compression workflow

Hook up your server to TinyPNG and TinyJPG and compress all your images on the fly. The API uses the compression engine that powers the web services so you can expect exactly the same results. Enter your name and email address below to retrieve your key and get started.

Getting started

Once you retrieve your key, you can immediately start shrinking images. You can submit a PNG or JPEG file with any HTTP client. The server will compress your image and respond with a URL where you can grab the result.

curl --user api:YOUR_API_KEY \
     --data-binary @unoptimized.png -i

Official client libraries are available for Ruby, PHP, Node.js, Python and Java. You can also use our WordPress plugin or the Magento extension to compress your JPEG and PNG images.

For documentation and more code examples you can explore the API Reference.


The API compresses PNG and JPEG images. You only have to upload your source image and download the result. Everything else happens automatically.

If you use Amazon S3, you can instruct the API to store optimized images directly in your S3 bucket.

You can create resized versions of your images, which are immediately optimized. You only have to upload the original once. Take advantage of our smart cropping algorithm to create thumbnails. The API can resize images to a specific size and crop away the parts which are visually the least interesting.


You only pay for what you use. The first 500 compressions each month are free. You will only be billed if you compress more than 500 images.

There are no subscription costs, no file size limits and no minimum fees. Only successful compressions will be charged.

Images uploaded with APIPrice per image

  • First 500 images per monthfree
  • Next 9 500 images per month$0.009 per image
  • Over 10 000 images per month$0.002 per image
… or simply calculate your costs

Price calculator

2 000

$13.50per month

Try TinyPNG with a new browser

TinyPNG is created for modern browers with HTML5 & CSS3 support. We have not tried it out in other browsers. The site may work, or it may not. If you see this message you may want to try a different browser!