Retail POS Basket Data Generator

Basket-level point-of-sale transactions with real product affinities โ€” items that genuinely co-occur (chips + salsa + soda), plus store IDs, hour-of-day patterns, and a payment mix. The dataset market-basket and association-rule tutorials actually need.

SeededCSV + ExcelFraud labels100% in-browser

Example output โ€” a peek before you generate

datetimestore_idproductdepartmentquantityunit_priceline_total
2026-06-30 12:14S1Tortilla ChipsSnacks2$3.49$6.98
2026-06-30 12:14S1SalsaSnacks1$3.99$3.99
2026-06-30 12:14S1Soda 12pkSnacks1$6.99$6.99
2026-06-30 17:02S2SpaghettiPasta Night2$1.99$3.98

Notice the chips + salsa + soda basket โ€” that's a real product affinity, not chance. A real file has up to 200,000 rows; set your row count below and click Generate for your own.

Generate the dataset

Save / load scenario (stored only in this browser)

Quick-start presets

What's in this dataset

Each row is one item within a basket. Group by transaction_id to reconstruct each shopper's basket for association-rule mining.

ColumnTypeDescription
transaction_idintegerThe basket; multiple item rows share it.
datetimedatetimeTimestamp with realistic hour-of-day weighting.
store_idtextWhich store rang the sale (scales with row count).
product / departmenttextThe item and its aisle/department.
quantity / unit_pricenumberUnits and shelf price.
line_totalnumberquantity ร— unit_price.
paymenttextCard / Cash / Mobile.
anomaly0/1Present only with injection on; flags suspicious transactions (e.g. odd-hour high-value bulk).

Why it's realistic

The catalog is organized into affinity groups โ€” sets of items that really go together, like {tortilla chips, salsa, guacamole, soda} or {diapers, wipes, baby food}. Each basket draws one or two of these groups and co-purchases their members at high probability, with the occasional impulse buy mixed in. That means an association-rule miner (Apriori/FP-Growth) will actually surface lift between linked products โ€” the whole point of a market-basket exercise โ€” instead of finding nothing because the items were independent. Layer on weighted shopping hours, weekend/holiday traffic lifts, and multiple stores, and you get transaction data that behaves like a real grocery POS feed.

Good for

Market-basket analysis Association rules (Apriori / FP-Growth) Recommendation demos Store / hourly sales dashboards Fraud / anomaly detection SQL window-function practice

FAQ

How do I run market-basket analysis on this?

Group rows by transaction_id to form item lists, then feed them to Apriori or FP-Growth. You should see strong lift within the affinity groups baked into the catalog.

How many stores are there?

It scales with size โ€” from one store on small files up to eight on large ones โ€” so you can compare store performance.

Is anything uploaded?

No โ€” generation is 100% in your browser.