Shopify Store API — Download Product Images
Documentation menu
FetchLayer FetchLayer API

Download a product image

Stream a product image file, using a url taken from an image returned by /products or /product-detail. Only store image hosts are accepted. HTTP Range requests are supported, so a partial fetch works. This is a GET with query parameters, not a JSON POST, and it bills as one request.

GET /media Media
https://api.fetchlayer.dev/shopify-stores/media
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Product image URL, as returned on a product image. Passed as a query parameter.

filename string optional

Content-Disposition filename to serve the file as (max 200 characters).

Range string optional

Standard HTTP Range request header, for example bytes=0-65535. Sent as a header, not a query parameter.

Response Fields

media

Download a product image

(body) binary

The file itself. 200 for the whole file, 206 for a requested byte range.

Content-Type header

Media type of the image, e.g. image/jpeg or image/webp.

Content-Range header

Byte range served, on a 206 response.

Accept-Ranges header

Present when the file supports range requests.

Request

curl -X GET "https://api.fetchlayer.dev/shopify-stores/media?url=https%3A%2F%2Fcdn.shopify.com%2Fs%2Ffiles%2F1%2F0000%2F0001%2Fproducts%2Ftree-runner.jpg&filename=tree-runner.jpg" \
  -H "Authorization: Bearer ss-your-key"

Response

{
  "note": "Binary file streamed back with Content-Type, Content-Length and Accept-Ranges headers."
}