NYC Open Data (311) API
Free New York City 311 API with no key: every service request since 2010 with address, agency, status and coordinates, queryable with SoQL. Tested curl example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the NYC Open Data (311) API?
NYC Open Data runs on Socrata and needs no API key for moderate use. Its flagship dataset, 311 Service Requests, exposes every complaint New Yorkers have filed since 2010 — complaint type, responding agency, address, borough, status and coordinates — filterable with SoQL query parameters.
The 311 dataset is the reason most developers meet Socrata at all. It is enormous, it updates continuously, and each row is a small civic story: a blocked driveway in East Elmhurst reported at 01:50, routed to the NYPD, marked In Progress, geocoded to a block and a police precinct. Because Socrata exposes SoQL — a SQL-shaped query language sent as `$where`, `$select`, `$group` and `$order` parameters — you can aggregate on the server instead of downloading millions of rows.
Two quirks catch people out. Numeric-looking columns come back as strings (`latitude` is `"40.765..."`, not a float), so cast before doing arithmetic. And several columns are prefixed `:@computed_region_` — those are Socrata's automatic spatial joins onto community districts and similar boundaries, not city data, and they are safe to drop. The `$limit` default is 1,000 rows, which is the other common surprise when a query silently returns less than you expected.
Quick facts
- Base URL
https://data.cityofnewyork.us/resource- Authentication
- No key needed for reasonable volumes. A free Socrata app token raises throttling limits, but it is not required and anonymous requests are not blocked.
- Rate limit
- Anonymous requests share a per-IP throttle pool. Heavy scraping is throttled rather than refused; an app token moves you to a higher bucket.
- Pricing
- Free. NYC Open Data is published under the city's open data terms of use.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the NYC Open Data (311) API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Fetch the most recent 311 service request
GET https://data.cityofnewyork.us/resource/erm2-nwe9.json?$limit=1
curl 'https://data.cityofnewyork.us/resource/erm2-nwe9.json?$limit=1'const res = await fetch("https://data.cityofnewyork.us/resource/erm2-nwe9.json?$limit=1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://data.cityofnewyork.us/resource/erm2-nwe9.json?$limit=1", timeout=20)
res.raise_for_status()
print(res.json())[
{
"unique_key": "70117611",
"created_date": "2026-08-20T01:50:51.000",
"agency": "NYPD",
"agency_name": "New York City Police Department",
"complaint_type": "Blocked Driveway",
"descriptor": "Partial Access",
"location_type": "Street/Sidewalk",
"incident_zip": "11369",
"incident_address": "24-29 95 STREET",
"street_name": "95 STREET",
"cross_street_1": "24 AVENUE",
"cross_street_2": "JACKSON MILL ROAD",
"intersection_street_1": "24 AVENUE",
"intersection_street_2": "JACKSON MILL ROAD",
"address_type": "ADDRESS",
"city": "EAST ELMHURST",
"landmark": "95 STREET",
"status": "In Progress",
"community_board": "03 QUEENS",
"council_district": "21",
"police_precinct": "Precinct 115",
"bbl": "4011060053",
"borough": "QUEENS",
"x_coordinate_state_plane": "1018980",
"y_coordinate_state_plane": "218103",
"open_data_channel_type": "ONLINE",
"park_facility_name": "Unspecified",
"park_borough": "QUEENS",
"latitude": "40.76525055292101",
"longitude": "-73.87462516861908",
"location": {
"type": "Point",
"coordinates": [
-73.874625168619,
40.765250552921
]
},
":@computed_region_f5dn_yrer": "65",
":@computed_region_yeji_bk3q": "3",
":@computed_region_sbqj_enih": "73",
":@computed_region_92fq_4b7q": "21"
}
]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$limit | query | Optional | Rows to return. Defaults to 1,000 and caps at 50,000 per request. 1 |
$offset | query | Optional | Pagination offset. Pair with a stable `$order` or rows will repeat. 1000 |
$where | query | Optional | SoQL filter expression, including date comparisons and spatial predicates. complaint_type='Noise - Residential' |
$select | query | Optional | Columns to return, with aggregate functions allowed. borough, count(*) |
$group | query | Optional | Group-by clause, used with aggregates in `$select`. borough |
$order | query | Optional | Sort clause. Always set one when paginating. created_date DESC |
$q | query | Optional | Full-text search across the whole row. pothole |
Response fields
unique_keystring- Stable identifier for the service request.
created_date / closed_datestring- Floating timestamps with no timezone suffix — they are local New York time.
agency / agency_namestring- Short code and full name of the responding agency, for example `NYPD`.
complaint_type / descriptorstring- Category and sub-category. `complaint_type` is the field worth faceting on.
statusstring- `Open`, `In Progress`, `Closed` and similar values.
borough / community_board / council_districtstring- Political and administrative geography attached to each request.
latitude / longitudestring- Coordinates as strings, not numbers. Cast before using them.
locationobject- GeoJSON Point with numeric coordinates — easier to consume than the string pair.
:@computed_region_*string- Socrata's automatic spatial joins. Not city data; safe to ignore.
What you can build with the NYC Open Data (311) API
- Map noise, rat or pothole complaints by neighbourhood
- Aggregate complaint volume per agency without downloading the raw rows
- Track response times by comparing `created_date` and `closed_date`
- Feed a civic dashboard with live 311 activity
- Study seasonality in heating and hot water complaints
Common errors and how to fix them
400 with a SoQL parse message
Malformed `$where` or `$select` clause.
Fix: String literals use single quotes; column names are lowercase with underscores. The message names the offending token.
Fewer rows than expected
The default `$limit` is 1,000.
Fix: Set `$limit` explicitly, up to 50,000, and page with `$offset` plus a stable `$order`.
429
Anonymous per-IP throttling.
Fix: Slow down, cache results, or register a free app token to move into a higher limit bucket.
Arithmetic on latitude gives NaN
Coordinates are strings.
Fix: Cast to float, or read the numeric pair from the `location` GeoJSON object instead.
NYC Open Data (311) API — frequently asked questions
Do I need an API key for NYC Open Data?
No. Anonymous requests work and are not blocked. A free Socrata app token only raises your throttling limit, which matters for bulk work but not for ordinary use.
What is SoQL?
Socrata's SQL-shaped query language, passed as `$select`, `$where`, `$group`, `$order` and `$limit` parameters. It runs server-side, so you can compute counts per borough without transferring the underlying rows.
How far back does the 311 data go?
To 2010, and it is appended continuously — the most recent row returned during testing was hours old. That makes it one of the largest continuously updated municipal datasets published anywhere.
Why do the timestamps have no timezone?
Socrata floating timestamps carry no offset. For this dataset they represent local New York time, so apply America/New_York yourself rather than assuming UTC.
Tools that pair with this API
CSV to JSON Converter
Convert CSV to a JSON array of objects online. Header-row detection, comma/semicolon/tab delimiters and pretty-printed output — 100% in your browser.
Coordinate Converter
Convert GPS coordinates between decimal degrees, degrees-minutes-seconds and decimal minutes instantly. Paste any format like 40°26'46"N and copy the result.
Timestamp Converter
Convert timestamps to human-readable dates and dates back to timestamps. Auto-detects seconds vs milliseconds, shows local, UTC and ISO 8601 formats.
NYC Open Data (311) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.