Product Description Generation

This page describes the API for automatically generating product descriptions using structured product information and, optionally, product images. It follows the general conventions of the Ximilar API as outlined in the First steps section.

This service helps generate compelling, consistent, and SEO-friendly product descriptions at scale. Example use cases include:

  1. Generating SEO-optimized product descriptions quickly and efficiently
  2. Maintaining a consistent brand voice and style across your catalog
  3. Enhancing product discovery with relevant keywords and attributes

Endpoints

This service API has one endpoint available at this URL:

https://api.ximilar.com/product-description/v2/generate

POST/v2/generate

Generate Product Description

This endpoint generates unique product descriptions for each record based on product information and optionally provided images. If image URL is provided and a tagging_type is specified, the API will first extract relevant tags using Ximilar's product tagging models (fashion, home decor) to enhance the description.

Required attributes

  • Name
    records
    Type
    array
    Description

    List of product records to generate descriptions for.

  • Name
    product_info
    Type
    object
    Description

    Any relevant product information in dictionary.

  • Name
    product_type
    Type
    string
    Description

    The product type defined by customer (e.g., Fashion, Home Decor, or Real Estate).

  • Name
    style_name
    Type
    string
    Description

    Writing style (e.g., product-short or product-medium).

Optional attributes

  • Name
    _url
    Type
    string
    Description

    Single image URL.

  • Name
    _urls
    Type
    array
    Description

    Multiple image URLs.

  • Name
    _base64
    Type
    string
    Description

    Base64 encoded image.

  • Name
    tagging_type
    Type
    string
    Description

    Type of tagging (fashion, home-decor, or gpt) for generating relevant keywords for the description.

  • Name
    flow_id
    Type
    string
    Description

    ID of a custom Flow to call before generating the description. If specified, the flow will be executed first, and the value from the field defined by flow_field in the flow's output will be used as the product description.

  • Name
    flow_field
    Type
    string
    Description

    Field from flow output to use for product description.

  • Name
    Top Category
    Type
    string
    Description

    If there are several products in the image, this tells us which one is the most important – the one the description should focus on.

  • Name
    Category
    Type
    string
    Description

    Category of the product.

  • Name
    _tags_map
    Type
    object
    Description

    Dictionary mapping of features and tags (usually from our tagging systems).

Returns

HTTP error code 2XX, if the method was OK, and other HTTP error code, if the method failed. The response body is a JSON object (map) with the following fields:

  • Name
    records
    Type
    array
    Description

    JSON array with the input records, each record enriched by field product_description.

  • Name
    status
    Type
    object
    Description

    A JSON map with a status of the method processing. It contains these subfields: code (numeric code of the operation status) and text (text describing the status code)

Request

POST
/v2/generate
curl https://api.ximilar.com/product-description/v2/generate -H "Content-Type: application/json" -H "Authorization: Token __API_TOKEN__" -d '{
  "records": [
    {
      "_url": "__IMG_URL__",
      "product_type": "Fashion",
      "product_info": {
        "brand": "Your Brand",
        "material": "100% leather",
        "color": "yellow",
        "size": "10",
        "seo_keywords": [
          "yellow pumps",
          "luxury"
        ]
      },
      "style_name": "product-medium",
      "tagging_type": "fashion",
      "Top Category": "Footwear",
      "Category": "Footwear/Pumps"
    }
  ]
}'

Response

{
  "records": [
    {
      "_url": "__IMG_URL__",
      "product_type": "Fashion",
      "product_info": {
        "brand": "Your Fashion Brand",
        "material": "100% leather",
        "color": "yellow",
        "size": "10",
        "seo_keywords": [
          "yellow pumps",
          "luxury"
        ]
      },
      "style_name": "product-medium",
      "tagging_type": "fashion",
      "Top Category": "Footwear",
      "Category": "Footwear/Sneakers",
      "_status": {
        "code": 200,
        "text": "OK",
        "request_id": "9ce0c2f8-7a0d-4d72-bad7-bd62cff35891"
      },
      "_id": "ad14e58e-9efc-4d3a-8ddf-c567f5087621",
      "_tags_map": {
        "Color": "yellow",
        "Gender": "women",
        "Material": "leather/faux leather shoes",
        "Style": "elegant",
        "Height": "low shoes",
        "Heel shape": "stiletto",
        "Heel height": "high",
        "Category": "Footwear/Sneakers",
        "Top Category": "Footwear"
      },
      "product_description": {
        "title": "Yellow Stiletto Pumps",
        "description": "Crafted in luxurious 100% leather, these elegant yellow stiletto pumps are designed for women with a taste for luxury. The low shoes feature a high stiletto heel, making them a stylish choice for any occasion. With a vibrant yellow hue, these pumps exude sophistication and glamour, perfect for those seeking a touch of luxury in their footwear collection. Ideal for adding a pop of color to your ensemble, these yellow pumps are a must-have for fashion-forward individuals."
      }
    }
  ],
  "status": {
    "code": 200,
    "text": "OK",
    "request_id": "9ce0c2f8-7a0d-4d72-bad7-bd62cff35891",
    "proc_id": "35965f5f-4082-4e68-83ca-4c6351ea109d"
  },
  "statistics": {
    "processing time": 3.5042316913604736
  }
}

Was this page helpful?