Search by image
Changed onUploads an image for product search, as the storefront camera search does (jpeg, png, jpg, gif, svg or webp, max 2 MB). Send it as a multipart image file, or as a base64 data URI in a JSON image. With Magic AI image search switched on, keywords holds search keywords and engine is ai; otherwise keywords is empty and engine is tensorflow, meaning the client derives the keywords from imageUrl itself, as the storefront does in the browser. Then search products with the keywords.
Request
- Base URLhttp://localhost:8000/api/shop
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Storefront API Key for authentication. Required for all shop/storefront API requests.
Locale code for localized data (e.g. "en", "fr", "ar"). Defaults to channel's default locale.
Channel code (e.g. "default"). Defaults to the current channel.
Currency code (e.g. "USD", "EUR", "INR"). Defaults to channel's base currency.
Request body
Example request
{
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."
}Response
The stored image and the keywords.
Changes
- info
endpoint added
- info