🔥/v1/batch/match-products

Available at https://api.theproductllm.com/v1/batch/match-products

Processes batch product matching jobs to determine if product pairs are the same product.

This endpoint accepts a JSONL file where each line contains two products to compare. The batch job will process all product pairs and return match results asynchronously.

Required Parameters

  • file: JSONL file upload. Each line must be a valid JSON object with the following structure.

{
  "product_left": {
    "title": "string (required)",
    "brand": "string (optional)",
    "code": "string (optional)",
    "description": "string or dict (optional)",
    "id": "string (optional)",
    "price": "string or float (optional)"
  },
  "product_right": {
    "title": "string (required)",
    "brand": "string (optional)",
    "code": "string (optional)",
    "description": "string or dict (optional)",
    "id": "string (optional)",
    "price": "string or float (optional)"
  }
}

Request

import requests
with open('product_pairs.jsonl', 'rb') as f:
    response = requests.post(
        "https://api.theproductllm.com/v1/batch/match-products",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        files={"file": f}
    )
print(response.json())

product_pairs.jsonl — example file below, each json is on a single line, lines separated by newline

{"product_left": {"title": "Apple AirPods Pro 2nd Generation", "description": "Active Noise Cancellation, Adaptive Transparency, Personalized Spatial Audio"}, "product_right": {"title": "AirPods Pro (2nd Gen)", "description": "Wireless earbuds with ANC and spatial audio support"}}
{"product_left": {"title": "Sony WH-1000XM5 Headphones", "description": "Premium wireless noise canceling headphones"}, "product_right": {"title": "Bose QuietComfort 45", "description": "Wireless Bluetooth noise cancelling headphones"}}

Response

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "total_rows": 100,
  "tokens": 45000,
  "message": "Batch inference job submitted successfully. Processing 100 product pairs."
}

Last updated