The basics
The endpoint for Housing Maintenance Code Violations is:
https://data.cityofnewyork.us/resource/wvxf-dwi5.json
It uses Socrata's SODA API with SoQL, a SQL-like query language. You add parameters such as $where, $order, $select and $limit. Use .csv instead of .json for spreadsheets. Light use works without a key; for heavier automated use, create a free app token on NYC Open Data.
Query examples
New violations in the last 7 days
…/wvxf-dwi5.json?$where=inspectiondate > '2026-10-18T00:00:00'&$order=inspectiondate DESC&$limit=5000
Only open Class B and C
…/wvxf-dwi5.json?$where=class in('B','C') AND violationstatus='Open'&$limit=5000
Keyword search (mold)
…/wvxf-dwi5.json?$where=upper(novdescription) like '%MOLD%' AND violationstatus='Open'&$order=inspectiondate DESC
One borough
…/wvxf-dwi5.json?boro=BROOKLYN&violationstatus=Open&$order=inspectiondate DESC
One building
…/wvxf-dwi5.json?bbl=2028400049
Count open violations per building
…/wvxf-dwi5.json?$select=bbl, housenumber, streetname, count(violationid) as total&$where=violationstatus='Open'&$group=bbl, housenumber, streetname&$order=total DESC&$limit=100
Encode spaces as %20 if a tool complains. Replace the dates with your own.
Pull it into Google Sheets
Use the CSV endpoint with IMPORTDATA:
=IMPORTDATA("https://data.cityofnewyork.us/resource/wvxf-dwi5.csv?$where=violationstatus=%27Open%27%20AND%20class=%27C%27&$limit=1000")
For a daily refresh without formulas, a small Google Apps Script with a time trigger works well. Excel users can use Data → From Web with the same URL.
Add owner and managing agent
Every violation has a registrationid. Join it to the Registration Contacts dataset (feu5-w2e2) to get the registered owner and managing agent. See how to find a building's owner and managing agent.
https://data.cityofnewyork.us/resource/feu5-w2e2.json?registrationid=200444
Want this automated?
I build these pipelines with Google Apps Script, n8n, Zapier and custom web apps. FindXProp runs this for a property-services team every day. See my automation services.
Frequently asked questions
Is the NYC Open Data API free?
Yes. You can query it without paying. An optional free app token raises rate limits for automated use.
What's the HPD violations dataset ID?
wvxf-dwi5 (Housing Maintenance Code Violations).
How do I get owner names with violations?
Join registrationid to the Registration Contacts dataset (feu5-w2e2).
Can I use the API from Google Sheets?
Yes. Use IMPORTDATA with the .csv endpoint, or Apps Script for scheduled pulls.