Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Given 2+ GTINs, produce a structured diff covering what matters for a purchase decision: price, certifications, ingredients/substances, net content, country of origin, brand ownership.

When to use

  • User says “which of these is better?” or “what’s the difference?”
  • Following find-alternative to justify why the alternative wins.
  • Before plan-shopping-trip to pick between two viable candidates.

Flow

Closient does not yet have a single comparison endpoint. The pattern is:

1. Fetch each product

GET /products/api/v1/products/{gtin_a}
GET /products/api/v1/products/{gtin_b}

2. Fetch side data per GTIN

  • GET /certifications/api/v1/products/{gtin} — certifications held
  • GET /compliance/api/v1/products/{gtin}/recalls?status=ONGOING — any active recalls (dealbreaker!)
  • If location is known, optionally check-product-availability for stock
    • price per store

3. Structure the diff

Group by category so the user can scan:
Price:            A=$4.99   B=$5.49
Net content:      A=946 mL  B=1 L
Certifications:   A=[organic, non-gmo]   B=[organic]
Country:          A=USA     B=Canada
Data confidence:  A=0.93    B=0.88
Active recalls:   A=none    B=none

4. Highlight meaningful differences

  • Certifications one has that the other lacks
  • Price per unit (normalize by net_content)
  • Brand ownership / claim status
  • Any recall on either → surface as critical

Guidance for agents

  • Normalize units: report price per standard unit (per 100 mL, per 100 g) rather than raw price; lets the user compare apples to apples.
  • Cite data quality: if confidence_score < 0.7 on a critical field, note that the data is inferred.
  • Recalls are a hard flag: any CLASS_I recall means that option is out.

Planned

A single POST /products/api/v1/compare endpoint accepting N GTINs and returning a structured diff with pre-normalized fields.
  • resolve-gtin — for each product being compared
  • check-recalls — critical safety check per candidate
  • find-alternative — often ends by calling this to justify the pick