Back to Features
⚙️

Image Classification

ActiveCoreMUSTFREE

What it does

Classify products directly from photos using AI vision analysis. Upload an image URL or base64-encoded image data, and POTAL will identify the product and assign the correct HS code. Supports JPEG, PNG, GIF, and WebP formats up to 5MB. Ideal for visual product catalogs or mobile-first workflows.

Required Fields for 100% Accuracy

0 required / 4 total
FieldTypeRequired
imageUrlstringopt
imageBase64stringopt
productHintstringopt
destination_countrystringopt

Tips for Best Accuracy

  • Either imageUrl or imageBase64 must be provided (one is required)
  • Clear, single-product photos yield the best results
  • productHint significantly improves accuracy for visually ambiguous products
  • Image classification uses AI vision — slightly slower than text-based classification

Common Mistakes

  • Providing both imageUrl and imageBase64 — use one or the other
  • Low-quality or cluttered images — crop to show only the product
  • Images with text overlays or watermarks — these confuse the vision model
  • Expecting the same confidence as text-based — image mode typically scores 0.7–0.9

How to use it

1

Prepare your image

Use a clear product photo. Supported formats: JPEG, PNG, GIF, WebP. Max size: 5MB.

2

Send as URL or base64

Include imageUrl for hosted images or imageBase64 for direct upload in the classify request.

3

Review detected product

The response includes detectedProductName showing what the AI identified from the image.

4

Refine if needed

Add a productHint to guide classification if the image is ambiguous.

API Reference

POST/api/v1/classify
Request
{
  "imageUrl": "https://example.com/product-photo.jpg",
  "productHint": "kitchen appliance"
}
Response
{
  "hsCode": "8516.79",
  "description": "Electric coffee maker",
  "confidence": 0.87,
  "detectedProductName": "Electric drip coffee maker",
  "alternatives": [
    {
      "hsCode": "8419.81",
      "confidence": 0.62
    }
  ]
}
cURL
curl -X POST https://potal.app/api/v1/classify \
  -H "X-API-Key: pk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"imageUrl":"https://example.com/product-photo.jpg","productHint":"kitchen appliance"}'

Related Features

Having issues?