CosmeScan Public REST API v1

Free, read-only REST API for decoding cosmetic, skincare, K-Beauty, and perfume batch codes across 2,375 brands.

Auth: None HTTPS: Yes CORS: Enabled (*) OpenAPI 3.1 Rate Limit: 6 req/min · 30 req/hr
Base URL
https://cosmescan-vision.guillaumefric0.workers.dev

Machine-readable spec: /v1/openapi.json (mirror: cosmescan.com/api/v1/openapi.json).

Fair-Use Rate Limits: To keep this API free and fast for everyone without requiring API keys, requests are strictly limited to 6 requests/minute and 30 requests/hour per IP address. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-RateLimit-Hourly-Remaining headers. Exceeding the limit returns HTTP 429 Too Many Requests with a Retry-After header.

Live Interactive Playground

Test the live GET /v1/decode endpoint directly from your browser:

Click "Decode live" to call GET https://cosmescan-vision.guillaumefric0.workers.dev/v1/decode?brand=dior&code=4B01

Endpoints

GET/v1/decode

Decodes a cosmetic or perfume batch code and returns manufacturing date, age, estimated unopened shelf life, freshness status, and counterfeit clone alerts.

ParameterRequiredDescription
brandYesBrand slug (e.g. dior, chanel, loreal-paris) or exact brand name.
codeYesAlphanumeric batch / lot code (1–32 chars, e.g. 4B01).
langNoOutput language for labels (en, fr, es, de, it, pt, pl, ja, zh, ko, ru, ar). Default: en.
curl -s "https://cosmescan-vision.guillaumefric0.workers.dev/v1/decode?brand=dior&code=4B01"
{
  "brand": {
    "id": "dior",
    "name": "Christian Dior",
    "conglomerate": "LVMH",
    "category": "Haute Parfumerie & Beauté",
    "formatExample": "4B01 (4 chars)",
    "unopenedShelfLifeMonths": 48,
    "defaultPaoMonths": 36,
    "hasDecennialCycle": true,
    "url": "https://cosmescan.com/brand/dior/"
  },
  "inputCode": "4B01",
  "normalizedCode": "4B01",
  "status": "FRESH",
  "statusLabel": "Fresh & Potent",
  "datePrecision": "month",
  "productionDate": "2024-02-01",
  "productionDateFormatted": "February 2024",
  "expiryDate": "2028-02-01",
  "expiryDateFormatted": "February 2028",
  "ageMonths": 33,
  "remainingMonths": 15,
  "knownClonedCode": false,
  "activeRecallsCount": 0,
  "sourceUrl": "https://cosmescan.com/brand/dior/",
  "attribution": "Powered by CosmeScan (https://cosmescan.com)"
}

GET/v1/brands

Searches the 2,375 supported brands by name, slug, conglomerate, or category. Capped at 50 results per request.

ParameterRequiredDescription
qNoSearch term (e.g. dior, LVMH, K-Beauty).
limitNoResults per page (1–50, default 20).
offsetNoPagination offset (default 0).
curl -s "https://cosmescan-vision.guillaumefric0.workers.dev/v1/brands?q=chanel&limit=5"

GET/v1/brands/{id}

Returns public metadata, batch code format example, physical code location, and recall count for a single brand slug.

curl -s "https://cosmescan-vision.guillaumefric0.workers.dev/v1/brands/dior"

Error Codes

HTTP StatusError CodeMeaning
400MISSING_PARAMETERS / INVALID_BATCH_CODEMissing brand or code, or invalid code format.
404BRAND_NOT_FOUNDUnknown brand slug (includes up to 3 closest suggestions).
429RATE_LIMIT_EXCEEDEDExceeded 6 req/min or 30 req/hour per IP. Check Retry-After.