Datadory notebook
Pharmacy Sales Dataset Demand Forecasting: Datasets, Joins and Pipeline
Pharmacy sales dataset demand forecasting starts with Kaggle's community-uploaded line-item pharmacy transactions - the only sales-level feed Datadory catalogs for drug retail, in CSV, Parquet and SQLite. Because those uploads are static, pair them with openFDA's daily NDC Directory, weekly recall alerts and GoodRx's daily price pages to keep a trained model anchored to live shelf reality.
1,744 datasets. Pick your catch.
What is a pharmacy sales dataset for demand forecasting?
A pharmacy sales dataset is transaction-level retail data: one row per line item dispensed or sold, with a date, a product identifier and usually a quantity and price. Demand forecasting needs exactly that shape, because weekly and seasonal patterns only emerge once you aggregate lines into a store-by-product-by-day grid. Kaggle Datasets - Pharmacy & Drug Retail Search is where Datadory catalogs this material: community-uploaded pharmacy sales transactions in CSV, Parquet and SQLite, tagged demand-forecasting and market-basket.
The catch is that these uploads are static. Kaggle hosts over 1 million public datasets overall, but individual pharmacy uploads range from kilobytes to a few hundred MB of CSV, most covering months to a few years of transactions before going quiet. So a forecast model built on them is a benchmark artifact, not an operating system: you train and compare architectures on the historical lines, then wire live signals around them from sources that do refresh.
That split defines every section below. Of the 16 primary Drug Retail datasets Datadory catalogs, all 16 are free, 11 ship through official APIs, and exactly one - the Kaggle search - carries line-item sales. Everything else earns its place by enriching, validating or refreshing what the sales file cannot tell you.
Which datasets actually contain line-item pharmacy transactions?
Treat the gap as a design constraint, not a blocker. Public pharmacy-sales work everywhere on Kaggle-style extracts follows the same recipe: forecast on the static line items, join enrichment from public regulatory and price feeds, and re-score whenever a source refreshes.
How do you build a demand-forecasting pipeline from these sources?
The working sequence, using only free inputs:
- Build the product master with the NDC Directory. The openFDA NDC Directory API lists 137,206 marketed finished drug products with nested package and active-ingredient rows, refreshed daily under commercial delivery terms as a single ~26.8 MB zipped partition. Join your file's product names or barcodes to NDC codes so every SKU inherits a labeler and marketing dates.
- Normalize messy drug strings with NLM. The Clinical Table Search Service returns RxTerms names with strengths, forms and routes (~9,300 names) plus 2,342 ingredients through a key-free JSON API advised at 25 requests per second - enough to reconcile 'amoxicillin 500mg cap' variants across uploads without registering for anything.
- Flag discontinued SKUs via Drugs@FDA. The openFDA Drugs@FDA API tracks 29,273 applications back to 1939 with marketing status and therapeutic equivalence codes, refreshed daily on weekdays, so products your model still expects to sell can be marked discontinued or substituted.
- Suppress forecasts during recalls. The openFDA Drug Enforcement / Recall API holds 17,876 reports since 2004 with classification, recalling firm and distribution pattern, refreshed weekly as one ~3.8 MB JSON file. A Class I recall explains a sales collapse better than any seasonality term.
- Benchmark honestly. Score candidate models on held-out weeks of the same static extract; the Kaggle upload will not grow under you mid-experiment, which makes results reproducible.
Pick up where this leaves off
Every one of these ships with sample rows before you commit to anything.
Kaggle Pharmacy & Drug Retail Datasets
Want rows instead of a pitch? Name the datasets.
API, files, or your warehouse. Daily, weekly, or hourly.
Get a sampleQuestions worth asking
Where can I get a pharmacy sales dataset for demand forecasting?
Kaggle Datasets - Pharmacy & Drug Retail Search aggregates community-uploaded line-item pharmacy transactions in CSV, Parquet and SQLite, free with a Kaggle account. Most uploads cover months to a few years and go static once published, so use them for training and benchmarks while openFDA feeds supply the live regulatory layer.
How do I map product names in my sales file to standard drug codes?
Join against the openFDA NDC Directory API, which lists 137,206 marketed finished drug products with nested package and ingredient rows, refreshed daily under commercial delivery terms. For fuzzy name normalization, call NLM's Clinical Table Search Service, a key-free JSON API over ~9,300 RxTerms names with strengths, forms and routes, advised at 25 requests per second.