Autoenhance.ai
  • Overview
  • Getting Started
    • Obtaining an API key
    • Quickstart
      • Single Image
      • HDR Brackets
    • Code Examples
      • JavaScript
        • Uploading Single Bracket
        • Uploading HDR
        • Uploading 360
      • API Integrations Repository
  • SDKs
    • Web (Beta)
      • Changelog
    • JavaScript
      • Changelog
    • Python
      • Changelog
  • File & Camera Guidelines
    • File Formats
    • Metadata
    • 360
    • Lens Correction
  • Images
    • Managing Images
      • Creating & Uploading
      • Reprocessing
      • Retrieveing
      • Deleting
      • Reporting
    • Settings
      • Enhancement Style
      • Sky Replacement
      • Lens Correction
      • Vertical Correction
      • Window Pull
      • Auto Privacy
      • Usage Example
    • Downloading Images
      • Original
      • Preview
      • Enhanced
  • Orders
    • Managing Orders
      • Creating
      • Editing
      • Retrieving
      • Listing and Pagination
      • Deleting
    • Grouping Brackets and Processing Orders
  • Webhooks
  • API Versions
  • AI Versions
  • Links
    • API Specification
    • Support
Powered by GitBook
On this page
  1. Images
  2. Downloading Images

Preview

PreviousOriginalNextEnhanced

Last updated 1 year 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'

Specification