Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Data & Analytics

Daily Online Grocery Price Index for Pakistani Cities with Product Matching

Build a pipeline that collects grocery prices from online stores every day, matches the same product across stores despite different names and pack sizes, and publishes a daily price index by city and item. Pakistan's official weekly price indicator is valuable but weekly and market-based. This project shows how online prices move between those releases, with every method choice written down.

Difficulty

Intermediate

A small team, or one strong student willing to learn something new.
Effort

1 to 2 semesters · 2 students

Deliverables

7 to ship

4 optional extras

Suggested stack

PythonPlaywright or ScrapyPostgreSQLrapidfuzz and sentence embeddingsApache Airflow or cronPlotly Dash or Streamlit
A suggestion, not a requirement. Swap anything for what you already know.

What you should ship

  • Polite collectors for at least three online grocery stores, respecting robots.txt, terms of use and rate limits
  • A price history table with store, city, product, pack size, unit price and availability for every day
  • A product matching step that links the same item across stores, with a hand-labelled test set to measure it
  • Unit price normalisation for pack sizes such as 1 kg, 900 g and 5 litre
  • A daily chained index for a basket aligned to items in the official Sensitive Price Indicator
  • A comparison of the online index with the weekly official figures over at least eight weeks
  • A public dashboard and a downloadable open dataset with a methods note

If you have time left

  • Detection of shrinkflation, where pack size falls while the shelf price stays the same
  • Alerts when an essential item's price jumps sharply in one city
  • Urdu product names in matching and in the dashboard
  • Weekly summaries written from the data with clear limits stated

The problem: prices change daily, official numbers arrive weekly

For a family in Pakistan, the price of flour, cooking oil, sugar and milk is the most important economic number there is. The Pakistan Bureau of Statistics publishes the Sensitive Price Indicator every week, covering 51 essential items collected from 50 markets in 17 cities. It is careful and trusted, but it is weekly, aggregate and based on physical markets.

Meanwhile, more people buy groceries online, and online stores publish their prices openly. Those prices change daily, often at the product and store level. Nobody turns them into a clean, documented open dataset that journalists, students and researchers can use to see what happens between official releases.

What already exists and the gap

  • The Sensitive Price Indicator and the monthly Consumer Price Index from the Pakistan Bureau of Statistics are the official measures.
  • PriceStats, a commercial company that grew out of MIT research, produces daily online inflation indices for many countries for paying clients.
  • Price comparison apps show today's cheapest store for a product, not a consistent index over time.

The gap is an open, transparent daily index for Pakistani cities, with product matching and methodology published, so that anyone can check and reuse it.

Inspiration

Cavallo and Rigobon's paper "The Billion Prices Project: Using Online Prices for Measurement and Research" (Journal of Economic Perspectives, 2016) describes how MIT researchers collected prices from online retailers daily and built inflation indices that tracked official figures closely, and in some countries revealed when official numbers were unreliable. Your project applies the same method to Pakistani grocery stores, at student scale.

What you build

  • Collectors visit each store's category pages once a day at a polite rate and save product name, pack size, price, discount and stock status.
  • The matching step links "Dalda Cooking Oil 1L Pouch" in one store to "Dalda Oil Pouch 1 Litre" in another, and normalises everything to a unit price.
  • The index follows a fixed basket aligned to the official item list, chained day to day.
  • The dashboard shows the index by city and by item, the official weekly figures alongside, and a downloadable dataset.

The technically interesting part

  • Product matching. Names mix English, Roman Urdu, brand abbreviations and inconsistent units. Combine rules (parse sizes and units with regular expressions), fuzzy string matching and sentence embeddings, then measure precision and recall on a set you label by hand. Wrong matches quietly corrupt the index, so prefer leaving an item unmatched over matching it wrongly.
  • Index method. Products appear, disappear and go out of stock. Use a chained geometric mean of price relatives (the Jevons index) for matched products, and decide and document how you treat stockouts and discounts.
  • Robust collection. Store sites change layout without warning. Build checks that alert you when the number of products collected drops sharply, rather than discovering a week of missing data later.
  • Being a good citizen. Collect once a day, identify your collector, respect robots.txt and terms of use, and store only public price information. If a store objects, remove it.

How to evaluate it

  • Matching quality: precision and recall on a hand-labelled set of at least 300 product pairs.
  • Coverage: share of basket items with a matched online price in each city, each day.
  • Agreement: correlation and lag between your weekly-averaged index and the official SPI for the same items.
  • Reliability: days with complete collection over the evaluation period, and how quickly breakages were detected.

Suggested plan

  • Weeks 1 to 3: choose stores and basket items, check terms of use, build the first collector.
  • Weeks 4 to 6: database schema, daily scheduling, size parsing and unit prices.
  • Weeks 7 to 9: product matching and the labelled test set.
  • Weeks 10 to 12: index calculation, comparison with official figures.
  • Weeks 13 to 15: dashboard, open dataset, methods note and report. Collection should run in the background from week 4 so you have enough history.

Path to a product

Newsrooms, think tanks, retailers and fast-moving consumer goods companies all want timely price data. An open public index with a paid data feed for businesses is a known model. The project also shows employers exactly the skills data engineering roles ask for: reliable collection, messy matching, documented methodology.

Scope warning

Start with three stores and twenty basket items, not every product. Do not attempt to collect from apps that require logins or bypass any protection. Do not present the index as an official inflation figure; call it an experimental online price index and say what it does not cover.

Learn what you need on Sefism

Get help with this idea

The two classic failures are wrong product matches and a collector that silently breaks. Tauseef can help you design the labelled test set, choose an index method you can defend and plan the comparison with official figures. If you are new here, create a free account first.

Ideas and guidance, not finished projects

These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.

Not sure this one fits you?

I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.

Discuss this idea
Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.