Overview
Socrata is a powerful open data platform that gives you access to thousands of government and civic datasets from around the world. You can query datasets from cities, states, and federal agencies using a SQL-like query language called SoQL. While it supports OAuth for write access, many public datasets can be read without authentication—making it a great starting point for civic data projects.
Beginner Tip
Many Socrata datasets are publicly readable without OAuth—just append ?$limit=10 to the dataset URL to fetch a small sample before diving deeper. When you do need OAuth, register your app at dev.socrata.com to get client credentials.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://data.cityofnewyork.us/resource/h9gi-nx95.json?$limit=5
- Result
- HTTP 200 · application/json · 3,031 bytes · compressed
- Response time
- 330 ms (median of 3) · fastest 308 ms
- Transport
- TLSv1.2 · ECDHE-RSA-AES128-GCM-SHA256 · certificate issued by GlobalSign nv-sa
- Browser CORS
- Allowed — Access-Control-Allow-Origin: *
- Served by
- nginx
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| crash_date | string (date) | 2021-09-11T00:00:00.000 |
| crash_time | string | 2:39 |
| on_street_name | string | WHITESTONE EXPRESSWAY |
| off_street_name | string | 20 AVENUE |
| number_of_persons_injured | string | 2 |
| number_of_persons_killed | string | 0 |
| number_of_pedestrians_injured | string | 0 |
| number_of_pedestrians_killed | string | 0 |
| number_of_cyclist_injured | string | 0 |
| number_of_cyclist_killed | string | 0 |
| number_of_motorist_injured | string | 2 |
| number_of_motorist_killed | string | 0 |
| contributing_factor_vehicle_1 | string | Aggressive Driving/Road Rage |
| contributing_factor_vehicle_2 | string | Unspecified |
Captured Response
Captured from a real request to https://data.cityofnewyork.us/resource/h9gi-nx95.json?$limit=5 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
[
{
"crash_date": "2021-09-11T00:00:00.000",
"crash_time": "2:39",
"on_street_name": "WHITESTONE EXPRESSWAY",
"off_street_name": "20 AVENUE",
"number_of_persons_injured": "2",
"number_of_persons_killed": "0",
"number_of_pedestrians_injured": "0",
"number_of_pedestrians_killed": "0",
"number_of_cyclist_injured": "0",
"number_of_cyclist_killed": "0",
"number_of_motorist_injured": "2",
"number_of_motorist_killed": "0",
"contributing_factor_vehicle_1": "Aggressive Driving/Road Rage",
"contributing_factor_vehicle_2": "Unspecified",
"…": "(3 more fields)"
}
] Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://data.cityofnewyork.us/resource/h9gi-nx95.json?$limit=5";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
{
"code": "dataset.missing",
"error": true,
"message": "Not found",
"data": {
"id": "h9gi-nx95.json"
}
} {
"code": "query.compiler.malformed",
"error": true,
"message": "Could not parse SoQL query \"select * limit !!!invalid!!!\" at line 1 character 16: Expected an integer, but got `!'",
"data": {
"query": "select * limit !!!invalid!!!",
"position": {}
}
} Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Related Tags
Similar APIs
View All →GENESIS
The GENESIS API provides access to official statistical data from the Federal Statistical Office of Germany (Destatis).
Wikidata
Wikidata is a free, collaboratively edited knowledge base maintained by the Wikimedia Foundation that stores structured data behind Wikipedia and other Wikimedia projects.
API Setu
API Setu is an Indian Government platform that aggregates a wide variety of official APIs covering KYC verification, business registration, education records, and employment data.
Microlink.io
⭐ Beginner's PickMicrolink.io lets you extract structured data—like titles, descriptions, images, and metadata—from any webpage using a simple HTTP request.
Nobel Prize
⭐ Beginner's PickThe Nobel Prize API provides free, open access to data about all Nobel Prize laureates and prize events since 1901.