Skip to main content
fastCRW Pergamon
Public records · US

NYC Open Data

data.cityofnewyork.us

New York City's open data: property, permits, 311, transport, health and everything else the city publishes.

Showing the catalogue

1Request

Socrata 4x4 id.

Grouping columns plus aggregate functions, sent upstream as $select. Alias each aggregate so you can sort on it.

Comma-separated columns to group on, sent upstream as $group. Must match the non-aggregate columns in select.

Sort over the aggregated result, sent upstream as $order. Usually the aggregate alias, descending.

Number of groups to return, sent upstream as $limit.

1 credit⌘ ↵
Code follows the fields above
curl "https://api.fastcrw.com/v1/data/nycopendata/aggregate?dataset=erm2-nwe9&select=complaint_type%2Ccount%28*%29+AS+n&group=complaint_type&order=n+DESC&limit=10" \
  -H "Authorization: Bearer $FASTCRW_API_KEY"

2Response example

A sample shape. Press Run to see live data from NYC Open Data.

JSON
[
  {
    "complaint_type": "Illegal Parking",
    "n": "2980356"
  },
  {
    "complaint_type": "Noise - Residential",
    "n": "2590401"
  },
  "… 8 more items"
]

Attribution: Source: NYC Open Data

Licence: NYC Open Data terms of use: the data is public and may be used for any purpose, including commercial.

Ask with this source

A prompt for your agent that names this source and how to call it through the crw MCP.

  • Grouped totals

    Use NYC Open Data (nycopendata) from fastCRW Pergamon, capability "Grouped totals" (aggregate). You want counts, sums or averages over a whole dataset instead of downloading its rows. Example options: dataset=erm2-nwe9, select=complaint_type,count(*) AS n, group=complaint_type. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "nycopendata" and capability "aggregate". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>

  • Dataset columns

    Use NYC Open Data (nycopendata) from fastCRW Pergamon, capability "Dataset columns" (columns). You are about to write a $where or $select and need the exact field names and types. Example options: dataset=erm2-nwe9. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "nycopendata" and capability "columns". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>

  • Dataset metadata

    Use NYC Open Data (nycopendata) from fastCRW Pergamon, capability "Dataset metadata" (dataset-metadata). You have a 4x4 id and want to know what the dataset is, who maintains it and how fresh it is. Example options: dataset=erm2-nwe9. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "nycopendata" and capability "dataset-metadata". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>

  • Search the data catalog

    Use NYC Open Data (nycopendata) from fastCRW Pergamon, capability "Search the data catalog" (datasets). You need to find which NYC dataset covers a topic, or you need its 4x4 id before querying rows. Example options: q=parking, only=dataset, limit=5. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "nycopendata" and capability "datasets". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>