Skip to content

API Endpoints

This section provides detailed documentation for all available Koral API endpoints.

All API requests should be made to the following base URL:

https://search.koral.com/api/v1
POST /search/image

Upload an image to find visually similar images.

Request Body:

{
"imageData": "<base64_encoded_image_data>",
"limit": 10,
"offset": 0,
"searchId": "<customer feed id>"
}

Parameters:

ParameterTypeRequiredDescription
imageDatastringYesBase64-encoded image data
limitintegerYesMaximum number of results (default: 10, max: 100)
offsetintegerYesOffset for pagination (default: 0)
searchIdstringYesCustomer feed id

Response:

[
{
"feed_id": "<customer feed id>",
"item_group_id": "Product group id, used to group variants",
"product_id": "Customer product id",
"title": "Product title",
"description": "Product description",
"age_group": "The age group of the product",
"availability": "in_stock | out_of_stock",
"brand": "Product brand",
"color": "Any color of the product",
"condition": "new | used | refurbished",
"gender": "The gender of the product",
"category": "Product category",
"gtin": "Global Trade Item Number",
"image_link": "URL of the product image",
"material": "Any material of the product",
"mpn": "Manufacturer Part Number",
"price": 30000, // Price in cents
"product_highlight": [
"Product highlight 1",
"Product highlight 2"
],
"product_type": "Tilbehør > Caps og kasketter", // Product type, google taxonomy
"sale_price": 30000, // Sale price in cents
"shipping_price": 3500, // Shipping price in cents
"shipping_country": "DK", // Shipping country
"shipping_weight": "", // Shipping weight
"short_title": "Product short title",
"size": "ONESIZE", // Product size
"link": "URL of the product page",
"product_updated_at": "", // Product updated at, provided by the customer
"currency": "DKK", // Currency of the product price
"shipping_currency": "DKK", // Currency of the shipping price
"score": 0.52604675, // Similarity score
"variants": [
{
"product_id": "Product id",
"color": "Color of the product variant",
"size": 46, // Size of the product variant
"price": 35000, // Price in cents
"currency": "DKK", // Currency of the product variant price
"sale_price": 35000, // Sale price in cents
"image_link": "URL of the product variant image",
"availability": "in_stock | out_of_stock",
"link": "URL of the product variant page",
}
],
"variant_count": 1
},
// More results...
]
POST /detect

Search for similar images using an image URL.

Request Body:

{
"imageData": "<base64_encoded_image_data>",
"searchId": "<customer feed id>",
"action": "OD"
}

Parameters:

ParameterTypeRequiredDescription
imageDatastringYesBase64-encoded image data
searchIdintegerYesCustomer feed id
actionobjectNoOptional specifies the actions to perform

Response: Same as Search by Image

{
"action": "<OD>",
"searchId": "<customer feed id>",
"results": {
"objects": [
{
"box": [120, 45, 280, 190],
"label": "person",
"score": 0.92
},
{
"box": [320, 150, 450, 280],
"label": "chair",
"score": 0.87
},
{
"box": [50, 200, 180, 350],
"label": "potted plant",
"score": 0.78
}
]
},
"processTimeSeconds": 1.25
}
POST /related

Find related products based on a reference image or product ID.

Request Body:

{
"imageData": "<base64_encoded_image_data>",
"productId": "<customer product id>",
"limit": 10,
"offset": 0,
"searchId": "<customer feed id>"
}

Parameters:

ParameterTypeRequiredDescription
imageDatastringNoBase64-encoded image data, if not provided product id is required
productIdstringNoCustomer product id, if not provided image data is required
limitintegerYesMaximum number of results (default: 10, max: 100)
offsetintegerYesOffset for pagination (default: 0)
searchIdstringYesCustomer feed id

Response:

[
{
"feed_id": "<customer feed id>",
"item_group_id": "Product group id, used to group variants",
"product_id": "Customer product id",
"title": "Product title",
"description": "Product description",
"age_group": "The age group of the product",
"availability": "in_stock | out_of_stock",
"brand": "Product brand",
"color": "Any color of the product",
"condition": "new | used | refurbished",
"gender": "The gender of the product",
"category": "Product category",
"gtin": "Global Trade Item Number",
"image_link": "URL of the product image",
"material": "Any material of the product",
"mpn": "Manufacturer Part Number",
"price": 30000, // Price in cents
"product_highlight": [
"Product highlight 1",
"Product highlight 2"
],
"product_type": "Tilbehør > Caps og kasketter", // Product type, google taxonomy
"sale_price": 30000, // Sale price in cents
"shipping_price": 3500, // Shipping price in cents
"shipping_country": "DK", // Shipping country
"shipping_weight": "", // Shipping weight
"short_title": "Product short title",
"size": "ONESIZE", // Product size
"link": "URL of the product page",
"product_updated_at": "", // Product updated at, provided by the customer
"currency": "DKK", // Currency of the product price
"shipping_currency": "DKK", // Currency of the shipping price
"score": 0.52604675, // Similarity score
"variants": [
{
"product_id": "Product id",
"color": "Color of the product variant",
"size": 46, // Size of the product variant
"price": 35000, // Price in cents
"currency": "DKK", // Currency of the product variant price
"sale_price": 35000, // Sale price in cents
"image_link": "URL of the product variant image",
"availability": "in_stock | out_of_stock",
"link": "URL of the product variant page",
}
],
"variant_count": 1
},
// More results...
]