pricelists.org embeddable widgets (v1)
Add one script tag, then drop the custom elements anywhere in your HTML:
<script src="https://pricelists.org/widgets/v1/pricelists.js" defer></script>
<pricelists-lowest-price product-id="1"></pricelists-lowest-price>
<pricelists-price-history product-id="1" days="90"></pricelists-price-history>
<pricelists-offer-comparison product-id="1" limit="5"></pricelists-offer-comparison>
<pricelists-availability product-id="1"></pricelists-availability>
<pricelists-badge type="published" merchant-slug="your-shop"></pricelists-badge>
Common attributes
product-id | Numeric id or prod_N. Either this or gtin is required (except the badge). |
|---|---|
gtin | EAN/GTIN — resolved via the public API; the first matching product is used. |
locale | pl or en (default en). UI strings and number formatting. |
theme | light or dark; omitted = follows the visitor's prefers-color-scheme. |
ref | Your partner slug — appended to every outbound link as ?ref=… together with utm_source=widget&utm_medium=embed. |
| fallback | Any HTML placed inside the element is shown if data cannot be loaded, e.g.<pricelists-lowest-price product-id="1"><a href="…">See prices</a></pricelists-lowest-price> |
1. Lowest price card — <pricelists-lowest-price>
light · by product-id
dark · by gtin
2. Price history chart — <pricelists-price-history>
Canvas min/max band + average line; the same points are exposed to screen readers as a visually-hidden table. Attribute days: 1–365 (default 90).
light · 90 days
dark · 30 days · pl
3. Offer comparison — <pricelists-offer-comparison>
Cheapest in-stock offers first (falls back to all offers). Attribute limit: 1–25 (default 5). Offer links use the canonical affiliate redirect URLs from the API.
light · limit 5
dark · limit 3 · pl
4. Availability — <pricelists-availability>
light
dark · pl
5. Merchant badge — <pricelists-badge>
Renders /badge/{merchant-slug}/{type}.svg (type: published or monitored) linking back to pricelists.org. The slug below is a placeholder — replace it with your merchant slug.
published
monitored
Notes
- No dependencies, no external CDNs; one ~19 kB script (7 kB gzipped). All widgets share a 5-minute in-memory response cache with ETag revalidation and automatic backoff on rate limiting.
- Every widget reports an anonymous impression once it becomes visible and a click event on outbound links (
POST /api/v1/track, fire-and-forget). - Data comes from the public read API:
/api/v1/products/{id},…/offers,…/price-history,…/statistics,/api/v1/products/by-gtin/{gtin}.