Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Will you have an API to Smush.it so that my tool can automatically smush images as they are published?

0
Posted

Will you have an API to Smush.it so that my tool can automatically smush images as they are published?

0

Yes, in fact the API came before the tool and our tool is using the API you can use yourself. The documentation is lacking but if you point your browser to a script called ws.php (as in “Web Service”) you should be able to figure it out. Some examples: http://smush.it/ws.php – gives a help message http://smush.it/ws.php?img=http://smush.it/css/skin/screenshot.png – example smushed response http://smush.it/ws.php?img=http://smush.it/css/skin/logo.png – image that cannot be further smushed All responses are in JSON format. The only required parameter is img. There are two optional parameters: • id – something that will help you identify the response if you send requests in a batch • task – something that will allow you to group together a bunch of images if you want to get the zip file after that. Make that as unique as possible. Here’s a scenario. You upload two images with the same task identifier: http://smush.it/ws.php?task=mytask&img=http://example.org/image1.png http://smush.it/ws.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123