Get Image
GET/:image-path
This API fetches an image, dynamically formats it, and returns the output image as a response. All query parameters are optional. If no parameters are provided, the original source image is returned.
If using this API to optimize web images on your website, the recommended parameters are:
format
set toauto
width
set to your desired image width
Notes about width
and height
parameters:
- If neither values are provided, the output image dimensions will be the same as the source image
- If either value is provided, the aspect ratio of the source image will be used to calculate the missing value
- If both values are provided, the output image will use the aspect ratio of the source image, cropping the image if needed
Request
Responses
- 200
- 400
- 403
- 404
- 500
Successful image response
Bad request
Unauthorized request
The requested image could not be found
An unexpected error occurred