---
title: "Search by image"
method: POST
path: "/image-searches"
tags: ["Product"]
---

# Search by image

`POST /image-searches`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/image-searches`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/image-searches/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads 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.

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Request body

- object
  - `image` string, required

## Response `201`

The stored image and the keywords.

## Other responses

- `400`: Invalid input
- `422`: Missing image, or not an allowed image type or size.

## Changes

- **2026-10-28** `b84d43839844`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bagisto/apis/bagisto-shop-api/changes/image-searches/post.md)

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
