Government — entry 015 of 90

City, New York Open Data

Verified Aug 2026

NYC Open Data runs on Socrata; a live keyless GET against the SODA endpoint for the 311 service-request dataset (`data.cityofnewyork.us/resource/erm2-nwe9.json`) returned full JSON with a wildcard `Access-Control-Allow-Origin` header, and the same resource is fetchable as CSV by swapping the file extension. Anonymous reads work without any credential; registering a free Socrata app token is optional and only raises the per-IP throttling limit.

NYC Open Data runs on Socrata's SODA (Socrata Open Data API) — the same query idiom used by dozens of other city and state open-data portals. A live keyless GET this run against /resource/erm2-nwe9.json?$limit=1 (the 311 service-request dataset) returned a genuine 801 B record at HTTP 200 with a wildcard Access-Control-Allow-Origin header, no key or app token required.

open-datagovernment-datasocratasoda-apinew-york
AuthenticationNone requiredCall it straight away — no key, no signup.
HTTPSSupportedTraffic is encrypted in transit.
CORSEnabledCallable directly from browser JavaScript.
PricingFreeNo paid tier — free for the documented use case.
FormatsJSON, CSVResponses can be requested as JSON or CSV.

GreatAPIs Score

Score94out of 100
Authentication25/25No authentication required
Pricing20/20Free to use
Docs14/20Documentation URL provided
Formats15/15Supports 2 response formats
Freshness20/20Verified within 6 months

Embed this badge

Scored 94 on greatapis.com
<a href="https://greatapis.com/api/city-new-york-open-data/"><img src="https://greatapis.com/badge/city-new-york-open-data.svg" alt="Scored 94 on greatapis.com"></a>

Auth quickstart

  1. No API key or app token required for anonymous reads — a live GET this run against /resource/erm2-nwe9.json?$limit=1 returned HTTP 200 on the first anonymous try. Registering a free Socrata app token is optional and only raises the per-IP throttling ceiling; it does not gate access.
Stored keyNo key stored

Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.

Fetch one 311 service-request record

GEThttps://data.cityofnewyork.us/resource/erm2-nwe9.json?$limit=1

200 application/json;charset=utf-8

[{"unique_key":"69897843","created_date":"2026-07-31T02:36:32.000","agency":"DOT","agency_name":"Department of Transportation","complaint_type":"Street Condition","descriptor":"Pothole","incident_zip":"11434","incident_address":"ROCKAWAY BOULEVARD","street_name":"ROCKAWAY BOULEVARD","cross_street_1":"132 AVENUE","cross_street_2":"BAISLEY BOULEVARD","address_type":"BLOCKFACE","city":"QUEENS","facility_type":"N/A","status":"Open","resolution_description":"The Department of Transportation referred this complaint to the appropriate Maintenance Unit for repair.","resolution_action_updated_date":"2026-07-31T02:36:32.000","community_board":"12 QUEENS","police_precinct":"Precinct 113","borough":"QUEENS","open_data_channel_type":"UNKNOWN","park_facility_name":"Unspecified","park_borough":"QUEENS"}]

A live GET this run against the same resource with $select=complaint_type,borough&$limit=2 returned exactly [{"complaint_type":"Request Large Bulky Item Collection","borough":"QUEENS"} ,{"complaint_type":"Noise - Residential","borough":"BROOKLYN"}] — confirming SODA's $select field projection works identically across every dataset resource on the portal, not just this one.

Try it

Developer reference

Base URLhttps://data.cityofnewyork.us
Key endpoints
  • GET/resource/{dataset-id}.json
  • GET/resource/{dataset-id}.csv
  • GET/api/views/metadata/v1/{dataset-id}

Gotchas & limits

  • An unknown resource ID is a real HTTP 404 with a typed JSON error, not an HTML page — a live GET this run against /resource/xxxx-yyyy.json returned exactly {"code":"dataset.missing","error":true,"message":"Not found","data":{"id":"xxxx-yyyy"}} (119 B).
  • A $where clause referencing a column that doesn't exist on the dataset is a real HTTP 400, and the error body echoes the entire rewritten SQL query back at you — a live GET this run against /resource/erm2-nwe9.json?$where=nonexistent_column=1 returned a 3,586 B body with "errorCode":"query.soql.no-such-column" and a line field containing the full generated SELECT ... WHERE statement with a ^ pointer at the bad column.
  • Swapping .json for .csv on the same resource does not return an identical column set — a live comparison this run showed the .json export's X-SODA2-Fields header ends with four Socrata-computed geography columns (:@computed_region_f5dn_yrer and three siblings) that the .csv export's own X-SODA2-Fields header omits entirely, even though both requests hit the same resource with no query params.
  • Omitting $limit does not return the whole dataset — a live GET this run against /resource/erm2-nwe9.json with zero query parameters returned exactly 1,000 records, Socrata's silent default page cap, not the dataset's real row count. Paging past it requires an explicit $limit/$offset (or $order for stable pagination).