Image Handling
Okasie automatically mirrors and optimizes images from your servers to ensure fast loading and consistent display across the platform.How It Works
When you submit a listing with image URLs:- Validation - We verify each URL is accessible
- Download - Images are downloaded from your server
- Optimization - Images are resized and compressed
- CDN Hosting - Optimized images are served from our CDN
- Caching - Original URLs are cached for future updates
Submitting Images
Single Listing
Include images in theimages array when upserting:
Bulk Upsert
Same format for bulk operations:Image Requirements
| Requirement | Specification |
|---|---|
| Formats | JPEG, PNG, WebP |
| Minimum size | 800 x 600 pixels |
| Maximum size | 20 MB per image |
| Maximum count | 50 images per listing |
| URL accessibility | Must be publicly accessible |
Image Processing
Automatic Optimization
Okasie automatically:- Resizes to multiple dimensions (thumbnail, preview, full)
- Compresses using modern codecs (WebP, AVIF)
- Strips metadata for privacy
- Generates placeholders for lazy loading
Generated Sizes
| Size | Dimensions | Use Case |
|---|---|---|
| Thumbnail | 150 x 100 | Search results grid |
| Preview | 400 x 300 | Listing cards |
| Gallery | 800 x 600 | Detail page gallery |
| Full | Original (max 2000px) | Lightbox view |
Image Order
The first image in your array becomes the primary/cover image:Updating Images
Full Replacement
Send the complete new image array to replace all images:Adding Images
Include all existing images plus new ones:Reordering Images
Simply send the images in the new desired order:Caching Behavior
URL-Based Caching
Okasie caches images by URL. If you update an image on your server without changing the URL, add a cache-busting parameter:CDN Cache Duration
| Cache Type | Duration |
|---|---|
| Browser | 1 year |
| CDN Edge | 30 days |
| API response | Real-time |
Error Handling
Common Image Errors
| Error | Cause | Solution |
|---|---|---|
IMAGE_FETCH_FAILED | URL not accessible | Check URL accessibility |
IMAGE_TOO_LARGE | Exceeds 20 MB | Compress before upload |
IMAGE_INVALID_FORMAT | Unsupported format | Convert to JPEG/PNG/WebP |
IMAGE_TOO_SMALL | Below 800x600 | Use higher resolution |
Partial Success
Image processing doesn’t block listing creation. If some images fail:Best Practices
Consistent Naming
Use consistent, descriptive filenames that help with debugging
HTTPS Only
Always use HTTPS URLs for security
Stable URLs
Keep image URLs stable; avoid temporary signed URLs
Pre-optimize
Compress images before sending to reduce processing time
CDN URLs
After processing, images are available at:images array in listing responses contains these CDN URLs, not your original URLs.