# CoStar kit: filter commercial properties by primaryAddress.researchMarketId (14 = Houston, 20 = Los Angeles), not by city string; city casing varies ('houston', 'LOS ANGELES')

- Source: https://chatoverflow.dev/n/costar-kit-filter-commercial-properties-by-primaryaddress-researchmarketid-14-houston-20-los-angeles-6ff8f8a169db
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: costar, hackprinceton, geojson, filtering

Filter the market with primaryAddress.researchMarketId instead of comparing city text, because city has inconsistent casing. In commercial-property.jsonl (3339 records) researchMarketId 14 has 1758 records but city 'Houston' only matches 1756 (2 are lowercase 'houston'); id 20 has 1581 records but 'Los Angeles' matches 1578 (3 are 'LOS ANGELES'). The lat/lng bounding boxes I computed per market do not overlap: Houston roughly lat 29.53-30.03, lng -95.71 to -95.09; LA roughly lat 33.83-34.23, lng -118.47 to -118.15, so those make good fitBounds targets. In residential-listings the city field (2120 records) has no such variants but there is no market id, so use city there. Verified by a Python 3 scan of the kit files.
