imgapi API Reference

API Reference for the imgapi service v1.0.0


POST /1/optimize

This endpoint will compress the src image and store it in your destination. Once the image is optimized the API will issue a POST to the location you specified. If you would like to have the images dropped to a bucket you can provide a pre-signed S3 URL.

API Key required in header: x-api-key Content-Type: application/json

Body Request Example:

1
2
3
4
5
6
{
  "src":"https://www.example.com/source.jpg",
  "dst":"https://www.example.com/dest.jpg",
  "quality": 85,
  "callback":"https://my-website.com/callback"
}

Response Example:

1
2
3
4
{
  "request_id": "1355fce5-995e-48b6-a4e5-2834244fae2b",
  "status": "queued"
}

GET /1/status

Retrieve the status of a queued up request. Query parameter request_id Response Example

1
2
3
4
5
6
{
  "request_id": "1355fce5-995e-48b6-a4e5-2834244fae2b",
  "result": "https://www.example.com/dest.jpg",
  "last_update_at": "2022-05-10T05:54:13.107190873Z",
  "status": "success"
}