NYC DOB API使用问题求助:字段缺失、过滤异常及替代API推荐
Hey there, let's break down your problems with the NYC DOB API and get you sorted, plus share some solid alternatives:
1. Fixing Your Current NYC DOB API Issues
1.1 Missing Permittee Detailed Address Field
Looking at the API's response structure, the 83x8-shf7 dataset simply doesn't include a dedicated permittee address field. This is a limitation of the specific subset you're using—some NYC OpenData datasets prioritize certain fields over others.
If you need this info, your best bet is to either:
- Link the permittee's license number (
permittee_s_license__) to another DOB dataset that tracks license holder addresses, or - Switch to a more comprehensive DOB permit dataset that includes this field (we’ll cover alternatives below).
1.2 Incomplete Results When Filtering by filing_date
The issue here has two key causes:
- Time Range Mismatch: Your query starts at
2018-05-01T06:00:00, but your expected data has afiling_dateof2018-05-01T00:00:00.000—which falls outside your start time, so it gets excluded. - Default Result Limits: Socrata (the platform powering NYC OpenData) caps default results at 1000 entries. If your date range has more data, you won’t see it without pagination.
Fixes to Try:
- Adjust your filter to cover full days: Ignore time values and include all dates in your range with this query:
https://data.cityofnewyork.us/resource/83x8-shf7.json?$where=DATE(filing_date) BETWEEN '2018-05-01' AND '2018-05-30' - Explicitly cover all hours: If you need to retain time precision, expand your range to include the full day:
https://data.cityofnewyork.us/resource/83x8-shf7.json?$where=filing_date BETWEEN '2018-05-01T00:00:00' AND '2018-05-30T23:59:59' - Add pagination for large datasets: Use
$limitand$offsetto fetch batches of results. For example, to get the first 5000 entries:
Increase thehttps://data.cityofnewyork.us/resource/83x8-shf7.json?$where=DATE(filing_date) BETWEEN '2018-05-01' AND '2018-05-30'&$limit=5000&$offset=0$offsetvalue (e.g., 5000, 10000) to retrieve subsequent batches.
2. Alternative NYC DOB Permit APIs
If you need more comprehensive data (including permittee addresses), these datasets are better fits:
- DOB Job Filings (All) (Dataset ID:
ic3t-wcy2): A full dataset of all DOB job filings, including permittee address fields likepermittee_s_address,permittee_s_city, andpermittee_s_zip_code. It supports the same Socrata query syntax. - DOB Permit Issuance (Dataset ID:
pvqr-7yc4): A focused dataset for issued permits with expanded contact fields for permittees, owners, and site managers. - DOB Approved Permits (Dataset ID:
6bgk-3dad): Includes permits that have been approved, with detailed permittee and project location data.
Example Query for Alternative API
Here’s how to fetch May 2018 permits with permittee addresses using the ic3t-wcy2 dataset:
https://data.cityofnewyork.us/resource/ic3t-wcy2.json?$where=DATE(filing_date) BETWEEN '2018-05-01' AND '2018-05-30'&$select=bin__, filing_date, permittee_s_business_name, permittee_s_address, permittee_s_zip_code
内容的提问来源于stack exchange,提问作者omkar kale
相关产品推荐
相关产品推荐

