Back to Features
⚙️

Batch Classification

ActiveCoreMUSTFREE

What it does

Classify hundreds of products at once via the batch API. Upload a JSON array of products and receive HS codes for all of them in a single request. The batch endpoint processes items in parallel (10 concurrent) with built-in deduplication — if the same product name appears multiple times, it's classified once and the result is reused.

Required Fields for 100% Accuracy

2 required / 9 total
FieldTypeRequired
items[].idstring!
items[].productNamestring!
items[].materialstringopt
items[].categorystringopt
items[].processingstringopt
items[].compositionstringopt
items[].weight_specstringopt
items[].pricenumberopt
items[].origin_countrystringopt

Tips for Best Accuracy

  • Each item requires id + productName at minimum
  • More fields per item = higher confidence scores
  • Duplicate productNames are auto-deduplicated — classified once, result copied to all matching IDs
  • Max items per request: 500 (Forever Free plan)

Common Mistakes

  • Missing id field — results cannot be mapped back without unique IDs
  • Exceeding batch limit — check your plan limit (500 for Forever Free)
  • Inconsistent field naming — use snake_case for batch items (origin_country not originCountry)

How to use it

1

Prepare your product list

Create a JSON array with each item having a unique id and productName at minimum.

2

Send the batch request

POST /api/v1/classify/batch with your items array. Max items: 500 (Free plan).

3

Map results by ID

Each result includes the original id you provided for easy mapping back to your catalog.

4

Handle failures

Items that fail classification will have an error field. Retry these individually with more detail.

API Reference

POST/api/v1/classify/batch
Request
{
  "items": [
    {
      "id": "SKU-001",
      "productName": "Cotton t-shirt"
    },
    {
      "id": "SKU-002",
      "productName": "Ceramic mug"
    },
    {
      "id": "SKU-003",
      "productName": "Leather wallet"
    }
  ]
}
Response
{
  "success": true,
  "results": [
    {
      "id": "SKU-001",
      "hsCode": "6109.10",
      "confidence": 0.94,
      "description": "T-shirts, of cotton"
    },
    {
      "id": "SKU-002",
      "hsCode": "6912.00",
      "confidence": 0.91,
      "description": "Ceramic tableware"
    },
    {
      "id": "SKU-003",
      "hsCode": "4202.31",
      "confidence": 0.89,
      "description": "Wallets, of leather"
    }
  ],
  "batchSize": 3,
  "processedAt": "2026-03-29T12:00:00Z"
}
cURL
curl -X POST https://potal.app/api/v1/classify/batch \
  -H "X-API-Key: pk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"id":"SKU-001","productName":"Cotton t-shirt"},{"id":"SKU-002","productName":"Ceramic mug"}]}'

Related Features

Having issues?