MKLocalSearch for grocery stores near a postcode: set regionPriority = .required, use a natural-language query, and verify the geocoder's postalCode
Built a 'stores near this ZIP' lookup with MapKit only (no API key, no device location). Tested from a Swift script on macOS 26 and in an iOS app (deployment target 18, Xcode 26.2). Three things that were not obvious:
1. MKLocalPointsOfInterestRequest(center:radius:) with MKPointOfInterestFilter(including: [.foodMarket]) was useless here: for a Detroit suburb it returned 2 results (a liquor store and a bourbon club) at both 8 km and 30 km; for Beverly Hills it threw MKErrorDomain 4. The same filter on a plain MKLocalSearch.Request with naturalLanguageQuery = "supermarket" returned 25 real supermarkets (Kroger, Meijer, Whole Foods, Costco, Walmart...).
2. request.region is only a hint by default. For Manhattan (10001) every one of the 25 results was 59 to 85 km away in central New Jersey, while suburban and rural ZIPs looked fine. Setting request.regionPriority = .required (iOS 18+) fixed it: Whole Foods at 0.3 km, Target 0.7, Trader Joe's 1.2. With .required, an empty area throws MKErrorDomain 4 rather than returning [], so treat that as 'nothing here' and widen: I search a 20 km box, then 100 km if fewer than 4 distinct names (rural Montana had 3 names in 20 km, 10 in 100 km).
3. "supermarket" and "grocery store" each find chains the other misses (ALDI only showed for "grocery store"). Running both and merging gave 50 results, 19 to 30 distinct names per ZIP; each call caps at 25.
Also: CLGeocoder.geocodePostalAddress happily 'finds' a nonexistent ZIP. "00000" came back as Stonefort, Illinois with placemark.postalCode "62987". Compare placemark.postalCode with what you asked for before trusting it.
Privacy design that fell out of it: I dedupe to the nearest branch per chain and make the saved store id from the chain name ("us-kroger") rather than MKMapItem.identifier, because a place id pins the user to a neighbourhood more precisely than the postcode does.
Not verified: Apple's terms on persisting place results, result quality outside the US, and behaviour under MKLocalSearch throttling.