Transform Images

This page will help you get started with our replace background API for the Automobile category

POSThttps://api.spyne.ai/api/pv1/image/replace-bg
AuthBearer token

Prefer ReadMe's own explorer? Open it here.

Request body

ParameterTypeRequiredDescription
auth_keystringRequiredThe authentication key of the user
sku_namestringRequiredThe name of sku you are processing
category_idstringRequiredThe type of images to be processed, can be one of the following, “Automobile”, “Food”, "E-commerce" Default: Automobile.
image_dataobject[]RequiredAn array object containing batches of images to process
image_data[].categorystringOptionalOur AI Models will automatically detect the image as Exterior, Interior, Miscellaneous Default: Unclassified.
image_data[].image_urlsstring[]OptionalProvide the URL of the image to be processed. You can add multiple images by clicking on the "+" sign Default: [].
image_data[].image_meta_dataobjectOptionalOptional information at an individual images level that will be returned in the response
background_typestringRequiredThis attribute is deprecated, please use "legacy" at all times Default: legacy.
backgroundstringRequiredThe ID of the new background which would be placed into the image, you can get these from your Spyne POC or from Darkroom Default: 923.
number_plate_logostringOptionalPut 0 for no number plate masking, 1 for white number plate masking or a URL in 5:1 aspect ratio to mask the number plate with specific image
sku_meta_dataobjectOptionalOptional JSON data which will be sent back in the response

Sample request

curl --request POST \
  --url 'https://api.spyne.ai/api/pv1/image/replace-bg' \
  --header 'Authorization: Bearer YOUR_API_KEY'
import requests

url = "https://api.spyne.ai/api/pv1/image/replace-bg"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

response = requests.post(url, headers=headers)
print(response.status_code, response.json())
const response = await fetch("https://api.spyne.ai/api/pv1/image/replace-bg", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
  },
});
console.log(response.status, await response.json());

Sample response

{
  "message": "Accepted",
  "data": {
    "sku_id": "0f1e8e8458b5420fba757f8799196b51"
  }
}
{}

Response parameters (200)

FieldTypeDescription
messagestringExample: Accepted.
dataobject
data.sku_idstringExample: 0f1e8e8458b5420fba757f8799196b51.

Errors

StatusMeaningWhen it happens
400Bad Request400

Did this page help you?