Size chart extraction

Updated at:

This API uses a multimodal large model to extract structured data from size chart images. It automatically identifies columns such as size, length, shoulder width, bust, and recommended weight, along with their units (cm/kg) and upper/lower bounds. You can specify a list of column names to extract and the output language (Chinese/English). The API is asynchronous.

Purpose and use cases

Size chart extraction is designed for categories such as apparel, footwear, bags, and jewelry. For these items, size charts are often embedded as images in the product details, which cannot be directly read by target platforms during cross-border listing. This API converts the size chart image into structured JSON that downstream services can use directly to:

  • Fulfill required attributes on platforms like TEMU and Amazon: Automatically populate structured attributes such as "Recommended Weight: 40–47.5 kg" or "Dress Length: 81 cm".

  • Localize size charts: Use the LanguageModel parameter to generate an English size chart directly, eliminating the need for a separate translation API call.

  • Import apparel products in bulk: Combine with the size chart detection API to first check if an image contains a size chart. You then only run this extraction API on relevant images to avoid unnecessary billing.

API

This API is asynchronous. You submit a task to receive a TaskId and then poll the query API for the result.

Submit an extraction task

POST /rest/ai/sizeChart/extract

Query the extraction result

POST /rest/ai/task/queryTaskResult

Request parameters (submission API)

Parameter

Type

Required

Description

ImageUrl

String

Yes

The URL of the size chart image. Requirements: JPG, JPEG, PNG, BMP, or WEBP format; resolution between 256×256 and 3000×3000 pixels; file size ≤ 10 MB.

ColumnNameList

String[]

No

The list of column names to extract (a column name allowlist). If you do not specify this parameter, the API extracts all columns. If specified, the API returns only the matched columns, reducing noise. Common columns include: Size, Bust, Length, Shoulder, Sleeve, Weight, Back Length, Cuff, Sleeve Width, Waist, Outseam, Inseam, Garment Length, Hip, Inside Diameter, Ring Size, Inside Circumference, Ring Size Number, Band Width, Chain Length, Thickness, Width, Height, Upper Width, Lower Width, and Depth.

LanguageModel

String

No

The output language: cn for Chinese or en for English. This parameter only applies when the source image is in Chinese or English. If the source image is in another language, the output remains in the original language.

Request parameters (query API)

Parameter

Type

Required

Description

TaskId

String

Yes

The task ID returned by the submission API. The task is valid for 24 hours.

Response fields

Submission API response

Field

Type

Description

Code

String

The business status code. A value of Success indicates a successful call.

Success

Boolean

Indicates whether the call was successful: true for success, false for failure.

RequestId

String

The unique request ID.

Data.TaskId

String

The asynchronous task ID, used to call the query API.

Query API response

The Result section of the query response contains the identified structured size chart data. The container fields use PascalCase, such as SizeChart, SizeChartAttributes, and IntersectionAttributes. The value fields inside each attribute object are the lowercase value and unit, and range values additionally contain upper_value and lower_value. Attribute names, such as Size and Bust, are dynamic fields that depend on the size chart content and the LanguageModel. Data.Result is an object and can be read directly without the need for further parsing.

Field

Type

Description

Data.Status

String

The task status: QUEUED, IN_PROGRESS, COMPLETED, or FAILED.

Data.TaskId

String

The asynchronous task ID.

Data.Result.Message

Object

The Message object uses the original image URL as its key (to support future expansion for multi-image submissions). Each Data.Result.Message.<url>.* field contains the extracted data for the corresponding image and can be used directly.

Data.Result.Message.<url>.SizeChart

Object[]

An array where each object represents one row of sizing information. Attribute names (e.g., Size, Bust) are dynamic. Each attribute is an object containing the lowercase fields value and unit (e.g., cm, kg). For range values such as recommended weight, it also includes upper_value and lower_value.

Data.Result.Message.<url>.IntersectionAttributes

String[]

A list of attribute names after language translation. If no translation occurs, this list is identical to the list of originally extracted attribute names.

Data.Result.Message.<url>.SizeChartAttributes

String[]

A list of the originally extracted attribute names.

Data.UsageMap.ProcessedImageCount

Number

The number of images processed in this request, used for billing.

Complete example

Sample submission request

{
  "ImageUrl": "https://example.com/dress-size-chart.png",
  "ColumnNameList": ["Size", "Bust", "Length", "Weight"],
  "LanguageModel": "en"
}

Sample query response

{
  "Code": "success",
  "Message": "Success",
  "Success": true,
  "RequestId": "21570000-0000-0000-0000-000000000003",
  "Data": {
    "TaskId": "c657386a-f39e-9888-8570-1ca8b4603c19",
    "Status": "COMPLETED",
    "Result": {
      "Message": {
        "https://example.com/dress-size-chart.png": {
          "SizeChart": [
            {
              "Size":   { "value": "S" },
              "Bust":   { "unit": "cm", "value": 84 },
              "Length": { "unit": "cm", "value": 81 },
              "Weight": { "unit": "kg", "upper_value": 47.5, "lower_value": 40 }
            },
            {
              "Size":   { "value": "M" },
              "Bust":   { "unit": "cm", "value": 88 },
              "Length": { "unit": "cm", "value": 82 },
              "Weight": { "unit": "kg", "upper_value": 55,   "lower_value": 47.5 }
            }
          ],
          "IntersectionAttributes": ["Size", "Bust", "Length", "Weight"],
          "SizeChartAttributes":   ["Size", "Bust", "Length", "Weight"]
        }
      }
    },
    "UsageMap": { "ProcessedImageCount": 1 }
  }
}

Recommendations

  • Detect before you extract: For bulk processing, first call the size chart detection API to filter out images that do not contain size charts. Then, run this extraction API only on the relevant images. This reduces invalid calls and can save 60% to 80% on costs.

  • Use a column name allowlist: E-commerce categories typically require only 5 to 8 columns. Specifying the ColumnNameList parameter prevents the model from misidentifying text like "Notes" or "Runs small" as attributes.

  • Handle columns for weight or recommended height: These columns often contain a range value, which is returned as upper_value and lower_value. Standard dimension columns return a single value. Your client application must handle both cases.

  • Set a polling interval: A typical task takes 10 to 30 seconds to complete. We recommend a polling interval of 5 seconds and a maximum wait time of 5 minutes.

Error codes

Error code

Triggering scenario

InvalidParameter

The ImageUrl is inaccessible or has an invalid format, or the LanguageModel value is not cn or en.

InputContentBlocked

The input image triggered a content moderation review.

DownstreamUnavailable

The image failed to download, or the downstream large model is temporarily unavailable. We recommend retrying with exponential backoff.

OutputContentBlocked

The model's output triggered a content moderation review. This is rare.

FreeQuotaExhausted

Your free trial quota has been used up.

InternalError

An internal server error occurred. Please save the RequestId and contact technical support.

For a complete list of error codes, see error codes.

Limitations

  • Call Pattern: Asynchronous. The query API has no QPS limit, but we recommend a polling interval of 5 seconds or more. The submission API has a default rate limit of 2 QPS and a maximum request timeout of 30 seconds. For more information, see rate limit.

  • Processing Time: A single image typically takes 10 to 30 seconds to process. Complex size charts (with multiple groups or languages) may take longer. Tasks are valid for 24 hours.

  • Input Image: JPG, JPEG, PNG, BMP, or WEBP format; resolution between 256×256 and 3000×3000 pixels; file size ≤ 10 MB.

  • Field Naming: In the response, the Result section retains the model's original snake_case naming convention. The outer-level fields, such as Code, RequestId, Data.TaskId, and Data.Status, use PascalCase.

  • Billing: ¥0.03 per image, based on the ProcessedImageCount. For more information, see Billing for Material Optimization.

FAQ

When should I use size chart extraction?

Use this feature when you need to submit or retrieve sizing information on a platform, but you only have size charts in an image format from your original product materials. This feature converts the size chart in the image into structured text.

What are the advantages of this API compared to using only OCR?

① Use the ColumnNameList parameter to select which columns to extract. ② Combine this API with the size chart detection API to filter out irrelevant images, avoiding unnecessary costs.

Next steps