Last updated 10 months ago
Preview images are lower resolution enhanced images.
The only requirement for downloading preview images is the image_id, you don't need an API key in order to be able to download the image.
const downloadPreviewImage = async (imageId) => { const response = await fetch( `https://api.autoenhance.ai/v3/images/${imageId}/preview`, { method: "GET" } ); const imageSource = await response.json() return imageSource }
import requests def download_preview_image(image_id): url = f'https://api.autoenhance.ai/v3/images/{image_id}/preview' response = requests.get(url) image_source = response.json() return image_source
$image_id = "ID_OF_YOUR_IMAGE"; function download_preview_image($image_id) { $url = "https://api.autoenhance.ai/v3/images/$image_id/preview"; $options = array( 'http' => array( 'method' => 'GET' ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { return 'Error downloading image'; } $image_source = json_decode($result, true); return $image_source; }
curl -X GET \ 'https://api.autoenhance.ai/v3/images/YOUR_IMAGE_ID/preview' \ -H 'Content-Type: application/json'