Get an optimization
Returns an optimization job's status, and once it succeeds, the download link and the optimization score of the optimized file.
GET
https://realpng.com/api/v1/optimize/{id}X-API-Key<token>
In: header
Path Parameters
id*string
Format
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl "https://realpng.com/api/v1/optimize/7c9e6679-7425-40de-944b-e07fc1f90ae7" \ -H "X-API-Key: $REALPNG_API_KEY"{ "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "status": "succeeded", "media": "image", "image_url": "https://realpng.com/api/v1/optimize/7c9e6679-7425-40de-944b-e07fc1f90ae7/image", "file_url": "https://realpng.com/api/v1/optimize/7c9e6679-7425-40de-944b-e07fc1f90ae7/file", "expires_at": "2026-09-26T10:15:03+00:00", "optimization_score": { "score": 92, "zone": "high" }}Start an optimization POST
Starts an optimization job, of an image or a video, and answers at once with its id. Poll GET /optimize/{id} or pass callback_url for a signed webhook.
Download an optimized file GET
Downloads the optimized file as an attachment, a PNG for an image or an MP4 for a video. Needs no key, so the link can be passed on until expires_at.