listloco-checker
v0.2.0
Published
Deterministic quality gates for Amazon.de-style marketplace listings: title length, banned words, required attributes, and number/model-number/unit preservation.
Downloads
312
Maintainers
Readme
listloco-checker
Deterministic quality gates for Amazon.de-style marketplace listings.
Try it in 30 seconds
npx listloco-checker listing.jsonCreate listing.json:
{
"title": "Acme Pro Laufschuh 42 EU - Netz, Schwarz, 1er Pack",
"brand": "Acme",
"material": "Netz",
"size": "42",
"color": "Schwarz",
"quantity": 1
}Output:
{
"pass": true,
"violations": [],
"gates": {
"titleLength": { "pass": true, "violations": [] },
"bannedWords": { "pass": true, "violations": [] },
"requiredAttributes": { "pass": true, "violations": [] }
}
}Pass a listing with a restricted term (e.g. "title": "Bestseller Laufschuh") and the exit code is 1 with violations non-empty.
For en→de localization, batch processing, and API integration, see the ListLoco Hosted API.
Checks:
- Title length — localized title must not exceed the marketplace character limit (200 chars for Amazon DE)
- Banned words — restricted absolute/superlative claims that can suppress or suspend a listing
- Required attributes — structured keys (brand, material, size, color, quantity) must be present and non-empty
- Number / model-number / unit preservation — hard facts (
42,AB-1200,cm,EU) must survive localization unchanged
Zero dependencies. Pure ESM. Node.js >= 18.
Install
npm install listloco-checkerName availability note:
listloco-checker(unscoped) is the first-choice identifier on the public registry. If that name is already taken, use the scoped form@<your-account>/listloco-checkerand adjust import paths accordingly.
Usage
import { check, amazonDeRules } from 'listloco-checker';
const result = check(
{
title: 'Acme Pro Laufschuh 42 EU - Netz, Schwarz, 1er Pack',
brand: 'Acme',
material: 'Netz',
size: '42',
color: 'Schwarz',
quantity: 1,
},
amazonDeRules
);
console.log(result.pass); // true
console.log(result.violations); // []Listing with a restricted term:
import { checkBannedWords, amazonDeRules } from 'listloco-checker';
const { pass, violations } = checkBannedWords(
'Nr. 1 Laufschuh — perfekt fur Marathons',
amazonDeRules
);
// pass === false
// violations[0].word === 'nr. 1'
// violations[1].word === 'perfekt'Checking number/model-number/unit preservation after localization:
import { checkPreservation } from 'listloco-checker';
const { pass, violations } = checkPreservation(
'USB-C hub, 65W, 4 ports', // English source
'USB-C Hub, 65W, 4 Ports' // German translation
);
// pass === true (65W and USB-C survived)API
check(listing, rules) → { pass, violations, gates }
Runs title-length, banned-word, and required-attribute gates in sequence.
| Parameter | Type | Description |
|-----------|------|-------------|
| listing | Object | Listing to check. Must include title: string for text gates. |
| rules | Object | Marketplace rule template (e.g. amazonDeRules). |
Returns:
pass—truewhen all gates passviolations— flat array of violation objects from all gatesgates— individual gate results keyed by gate name (titleLength,bannedWords,requiredAttributes)
checkTitleLength(title, rules) → { pass, violations }
Checks title.length <= rules.title.maxLength. Returns a title_length violation when exceeded.
checkBannedWords(text, rules) → { pass, violations }
Screens text for each term in rules.bannedWords. Matching is case-insensitive and whole-token — substrings do not trigger false positives.
checkRequiredAttributes(listing, rules) → { pass, violations }
Verifies that every key in rules.requiredAttributes is present and non-empty on listing.
checkPreservation(source, translated) → { pass, violations }
Verifies that every number, model number, and unit present in source also appears in translated. Use when checking a localized listing against its original.
amazonDeRules
Pre-built rule template for Amazon Germany (de-DE): 200-character title limit, 21 restricted terms, and 5 required attributes (brand, material, size, color, quantity).
When to use the hosted API
This package handles validation and gate logic locally with no API key required. Consider the ListLoco Hosted API when you need:
The npm package validates German listing fields locally. The hosted /try endpoint runs the en→de localization pipeline — free, no signup, no API key required.
curl -X POST https://listloco.hayasaka.app/try \
-H "content-type: application/json" \
-d '{
"listing": {
"title": "Cordless drill GSR-18V with 8.5 kg battery",
"brand": "Bosch",
"material": "Metall",
"size": "M",
"color": "blue",
"quantity": 1
},
"glossary": { "preserve": ["Bosch"] }
}'Returns { "localized": {...}, "gates": {...}, "violations": [...], "pass": true }. Free and rate-limited. For repeated or batch runs, use RapidAPI or the full API.
- en→de localization — translation is outside the scope of this package; the hosted API runs the full en→de localization pipeline
- Batch processing — send hundreds of listings through localization and quality gating via a single REST endpoint, without running your own pipeline
- API integration — connect from your e-commerce platform, ERP system, or automation script via standard HTTP
- Usage metering and quotas — per-listing tracking, plan limits, and usage reports are managed for you
- RapidAPI access — discover and trial the API via the RapidAPI marketplace: https://rapidapi.com/sakaiwork259601/api/listloco
Free checker vs hosted API
| Capability | This package (OSS) | Hosted API | |---|---|---| | Title length check | ✓ | ✓ | | Banned word detection | ✓ | ✓ | | Required attribute check | ✓ | ✓ | | Number / model / unit preservation | ✓ | ✓ | | en→de localization | — | ✓ | | Glossary management | — | ✓ | | Usage metering | — | ✓ | | RapidAPI gateway | — | ✓ | | Zero setup, no API key | ✓ | — |
Hosted API: https://listloco.hayasaka.app
Not affiliated with Amazon. "Amazon" is a trademark of Amazon.com, Inc.
License
MIT — see LICENSE.
