Image(s) in different sizes from API

Hello, Ghost’s,

From the API documentation, it seems we can only retrieve one image size(original?) from the API, e.g. from “/content/posts/{id}/” we get the attribute “feature_image”.

But is there a way we can get the resized version of the image for different displays etc.?

Best wishes,
Mikkel Lindhard

One option would be to reconstruct the resized URL based on the feature_image.

For example, if you’re returned and you know the sizes set by the theme, then you can safely reconstruct the resized image URL. For example, this is for AVIF:

You just need to substitute the desired width (w800) and format. Format can be omitted for the resized image in the original format.