Size chart extraction
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
LanguageModelparameter 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
For complete request signing instructions, SDK examples in Java, Python, Go, and other languages, and online debugging, see the Size Chart Extraction API (OpenAPI Portal) on the Alibaba Cloud OpenAPI Developer Portal.
Request parameters (submission API)
|
Parameter |
Type |
Required |
Description |
|
|
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. |
|
|
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: |
|
|
String |
No |
The output language: |
Request parameters (query API)
|
Parameter |
Type |
Required |
Description |
|
|
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 |
|
|
String |
The business status code. A value of |
|
|
Boolean |
Indicates whether the call was successful: |
|
|
String |
The unique request ID. |
|
|
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 |
|
|
String |
The task status: |
|
|
String |
The asynchronous task ID. |
|
|
Object |
The |
|
|
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 |
|
|
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. |
|
|
String[] |
A list of the originally extracted attribute names. |
|
|
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
ColumnNameListparameter 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_valueandlower_value. Standard dimension columns return a singlevalue. 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 |
|
|
The |
|
|
The input image triggered a content moderation review. |
|
|
The image failed to download, or the downstream large model is temporarily unavailable. We recommend retrying with exponential backoff. |
|
|
The model's output triggered a content moderation review. This is rare. |
|
|
Your free trial quota has been used up. |
|
|
An internal server error occurred. Please save the |
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
Resultsection retains the model's original snake_case naming convention. The outer-level fields, such asCode,RequestId,Data.TaskId, andData.Status, use PascalCase. -
Billing: ¥0.03 per image, based on the
ProcessedImageCount. For more information, see Billing for Material Optimization.
FAQ
Next steps
-
size chart detection: For bulk processing, use this API first to check if an image contains a size chart before running the extraction.
-
Product Material Optimization Pro: The Pro workflow for apparel automatically calls this API to generate size chart fields.