History
Classification history endpoints - browse, filter and retrieve details of your past classifications.
The history endpoints allow you to browse and filter all your past classifications. Every classification made via the API is automatically recorded and accessible.
List classification history
GET
/v1/classify/historyQuery parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
per_page | number | 20 | Results per page (max 50) |
from | string (ISO 8601) | - | Start date (inclusive) |
to | string (ISO 8601) | - | End date (inclusive) |
hs | string | - | Filter by HS code (prefix accepted, e.g. 8518) |
status | string | - | Filter by status: completed, failed |
source | string | - | Filter by source: api, web, batch |
all_keys | boolean | false | Include classifications from all API keys in the organization |
Example request
curl "https://api.thetradehub.eu/v1/classify/history?page=1&per_page=10&status=completed&from=2026-02-01T00:00:00Z" \
-H "X-API-Key: th_live_your_api_key"import httpx
client = httpx.Client(
base_url="https://api.thetradehub.eu",
headers={"X-API-Key": "th_live_your_api_key"},
)
response = client.get("/v1/classify/history", params={
"page": 1,
"per_page": 10,
"status": "completed",
"from": "2026-02-01T00:00:00Z",
})
data = response.json()
print(f"Total: {data['total']} classifications")
for item in data["items"]:
hs = item["result"]["classification"]["rankings"][0]["hs_code"]
print(f" {item['id']} - {hs} - {item['created_at']}")const params = new URLSearchParams({
page: "1",
per_page: "10",
status: "completed",
from: "2026-02-01T00:00:00Z",
});
const response = await fetch(
`https://api.thetradehub.eu/v1/classify/history?${params}`,
{ headers: { "X-API-Key": "th_live_your_api_key" } }
);
const data = await response.json();
console.log(`Total: ${data.total} classifications`);
for (const item of data.items) {
const hs = item.result.classification.rankings[0].hs_code;
console.log(` ${item.id} - ${hs} - ${item.created_at}`);
}Response
{
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "completed",
"content": "Wireless Bluetooth headphones",
"result": {
"classification": {
"rankings": [
{
"rank": 1,
"hs_code": "8518.30.00",
"description": "Headphones and earphones",
"confidence": 0.94
}
]
}
},
"source": "api",
"api_key_name": "Production Key",
"created_at": "2026-02-24T10:30:00Z"
}
],
"total": 156,
"page": 1,
"per_page": 10,
"pages": 16
}Paginated response structure
| Field | Type | Description |
|---|---|---|
items | object[] | List of classifications |
total | number | Total number of results |
page | number | Current page |
per_page | number | Results per page |
pages | number | Total number of pages |
Get classification detail
GET
/v1/classify/history/{log_id}Path parameters
| Parameter | Type | Description |
|---|---|---|
log_id | string (UUID) | Classification identifier |
Example request
curl https://api.thetradehub.eu/v1/classify/history/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "X-API-Key: th_live_your_api_key"import httpx
client = httpx.Client(
base_url="https://api.thetradehub.eu",
headers={"X-API-Key": "th_live_your_api_key"},
)
response = client.get("/v1/classify/history/a1b2c3d4-e5f6-7890-abcd-ef1234567890")
log = response.json()
print(f"Product: {log['content']}")
print(f"HS code: {log['result']['classification']['rankings'][0]['hs_code']}")
print(f"Confidence: {log['result']['classification']['rankings'][0]['confidence']}")const response = await fetch(
"https://api.thetradehub.eu/v1/classify/history/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
{ headers: { "X-API-Key": "th_live_your_api_key" } }
);
const log = await response.json();
console.log(`Product: ${log.content}`);
console.log(`HS code: ${log.result.classification.rankings[0].hs_code}`);
console.log(`Confidence: ${log.result.classification.rankings[0].confidence}`);Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "completed",
"content": "Wireless Bluetooth headphones with active noise cancellation",
"image_urls": ["https://example.com/product/headphones.jpg"],
"locale": "en",
"result": {
"classification": {
"rankings": [
{
"rank": 1,
"hs_code": "8518.30.00",
"description": "Headphones and earphones",
"confidence": 0.94,
"gri_justification": "GIR 1 - The product is specifically covered by heading 8518...",
"validated": true
}
]
},
"text": "Based on EU BTI rulings and TARIC nomenclature..."
},
"source": "api",
"api_key_name": "Production Key",
"session_id": "sess_abc123",
"created_at": "2026-02-24T10:30:00Z",
"updated_at": "2026-02-24T10:30:05Z"
}Advanced filters
Filter by HS code
The hs parameter accepts an HS code prefix. It filters classifications whose top result starts with that prefix:
# All products classified under chapter 85 (electrical machinery and equipment)
curl "https://api.thetradehub.eu/v1/classify/history?hs=85" \
-H "X-API-Key: th_live_your_api_key"
# Specific heading 8518 (microphones, loudspeakers, headphones)
curl "https://api.thetradehub.eu/v1/classify/history?hs=8518" \
-H "X-API-Key: th_live_your_api_key"Filter by date range
Combine from and to to restrict the time period. Dates must be in ISO 8601 format:
# Classifications from February 2026
curl "https://api.thetradehub.eu/v1/classify/history?from=2026-02-01T00:00:00Z&to=2026-02-28T23:59:59Z" \
-H "X-API-Key: th_live_your_api_key"Multi-key visibility
By default, only classifications made with the API key used for the call are returned. Enable all_keys=true to see classifications from all keys in your organization:
curl "https://api.thetradehub.eu/v1/classify/history?all_keys=true" \
-H "X-API-Key: th_live_your_api_key"Last updated