curl "https://api.genlook.app/storefront/v1/images?url=https://storage.googleapis.com/bucket-name/image.jpg&filename=My%20Try%20On.jpg" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..." \
--output downloaded-image.jpg
const downloadUrl = `https://api.genlook.app/storefront/v1/images?url=${encodeURIComponent(imageUrl)}&filename=${encodeURIComponent(filename)}`;
const response = await fetch(downloadUrl, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const blob = await response.blob();
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = filename;
link.click();
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Disposition: attachment; filename="Genlook - Your Try On - T-Shirt.jpg"
Content-Length: 245678
[binary image data]
Widget API Reference
Download Image
Download a try-on image as a file
GET
/
storefront
/
v1
/
images
curl "https://api.genlook.app/storefront/v1/images?url=https://storage.googleapis.com/bucket-name/image.jpg&filename=My%20Try%20On.jpg" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..." \
--output downloaded-image.jpg
const downloadUrl = `https://api.genlook.app/storefront/v1/images?url=${encodeURIComponent(imageUrl)}&filename=${encodeURIComponent(filename)}`;
const response = await fetch(downloadUrl, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const blob = await response.blob();
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = filename;
link.click();
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Disposition: attachment; filename="Genlook - Your Try On - T-Shirt.jpg"
Content-Length: 245678
[binary image data]
Proxy-download a try-on image from storage. Useful in iframe/cross-origin contexts where direct storage downloads are blocked by CORS.
On JavaScript, the
@genlook/storefront SDK is the recommended integration for the rest of the try-on flow; this endpoint is the one piece you call directly when you need a CORS-free download.
Query Parameters
string
required
Image URL from Genlook storage (GCS). Must point to the Genlook bucket.
string
Download filename. Defaults to
"Genlook - Your Try On.jpg".curl "https://api.genlook.app/storefront/v1/images?url=https://storage.googleapis.com/bucket-name/image.jpg&filename=My%20Try%20On.jpg" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..." \
--output downloaded-image.jpg
const downloadUrl = `https://api.genlook.app/storefront/v1/images?url=${encodeURIComponent(imageUrl)}&filename=${encodeURIComponent(filename)}`;
const response = await fetch(downloadUrl, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const blob = await response.blob();
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = filename;
link.click();
Response
Binary image file withContent-Disposition: attachment headers.
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Disposition: attachment; filename="Genlook - Your Try On - T-Shirt.jpg"
Content-Length: 245678
[binary image data]
Was this page helpful?

