A schema for crowdsourced café prices
Free-text submissions are easy to collect and a pain to analyse. A small, strict schema up front saves days of clean-up later.
{
"country": "HU", // ISO 3166-1 alpha-2
"city": "Budapest",
"cafe_type": "regular", // regular | specialty | chain | hotel
"price": 1290,
"currency": "HUF", // ISO 4217
"size_ml": 180,
"observed_on": "2026-10-14"
}
Validation rules
- Reject prices more than five median absolute deviations from the city median and queue them for review.
- Normalise city names against a reference list, so "Bp" and "Budapest" count as one place.
- Keep the raw submission next to the cleaned row, because you will want to re-run the cleaning later.
Wages live in a separate table keyed by country and year, and are joined in at analysis time.