Image search
Image search is a 2 step process. First, you send the image as a base64 encoded string to receive a slug id of the vectorized image. Second, you use that id to get search results of similar products.
Step 1: POST /vectorize-image
This endpoint lets you to create a vectorization id for an image by providing a base64 encoded string of the image.
Note: If you want to detect specific objects in an image before starting the image search process, you want to use the /detect-objects endpoint.
Headers
Authorization
string
Bearer token
Request body
The request passes the base64 encoded string of the image you want to use.
{
    "base64String": "string"
}Response
{
  "status": "success",
  "slug": "newRequest.slug"
}{
 "status": "error",
 "message": "Internal Server Error"
}Step 2: GET /search
This endpoint lets you to search products that match the image.
Headers
Authorization
string
Bearer token
Query parameters
imageId
string
Image search identifier.
Response
{
  "status": "success",
  "Products": [
        {
            "_id": "65d4d4f1b7bb634c6599ffd2",
            "name": "Calzuro Classic Without Holes Pistachio",
            "brand": "Calzuro",
            "storeName": "Calzuro",
            "slug": "calzuro-without-pistachio-eb12f468-48a2-48af-9f5e-3fda5f6c135c-1708446961787",
            "price": 111.99,
            "isVerified": true,
            "isBoosted": false,
            "images": [
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-1.jpg?v=1682709875",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/files/pistachiocalzuro.png?v=1712343485",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/files/classicinfographic_26486960-c007-4661-b74d-b50e158115cc.png?v=1712343485",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-2.jpg?v=1712343483",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-3.jpg?v=1712343483",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-4.jpg?v=1712343483"
            ],
            "url": "https://calzuro.com/products/calzuro-without-pistachio",
            "agoraScore": 95,
            "priceHistory": [
                {
                    "price": 111.99,
                    "date": "2024-02-20T16:36:01.992Z",
                    "_id": "671499c36ca0a1804aca445f"
                }
            ],
            "discountVal": 0,
            "averageRating": 4.5
        }
    ]
}{
 "status": "error",
 "message": "Internal Server Error"
}Last updated
Was this helpful?
