Socrata Open Data API Scraper icon

Developer tools

Socrata Open Data API Scraper

Point us at any Socrata Open Data (SODA) portal by domain and dataset ID and get clean, paginated JSON rows back -- 311 complaints, crime data, inspections, budget lines, any dataset any city, county, or state portal publishes, in one run.

Free Apify credit covers a first run. No credit card to try.

What this Actor scrapes

Several hundred US (and some EU) city, county, and state governments publish their open data through the Socrata Open Data API (SODA) — a standard /resource/<dataset-id>.json REST interface with a SQL-like query language (SoQL). Every portal exposes a different dataset: NYC's 311 complaints, Chicago's crime reports, Seattle's permits, LA's budget lines — same protocol, completely different columns.

This Actor is a generic, cross-portal harvester, not a single-vertical scraper. You supply a list of {portal_domain, dataset_id} pairs (plus optional SoQL filters), and we return every matching row from every target in one run — whatever shape that dataset happens to be.

What we handle for you

  • 🔁 We retry with exponential backoff on 429 and 5xx responses —
  • 📄 We page every target for you$limit/$offset walked
  • 🧩 We fan out across portals in one run — mix a 311 feed and a crime
  • 🧱 We isolate failures per target — an unknown or private dataset
  • 🧊 We keep the dataset clean — Pydantic-validated rows, ISO-8601
  • 💰 You pay only for results that land. No data → no charge beyond the

Use cases

  • Civic analytics — pull a city's 311 or crime feed on a schedule and
  • Journalism / research — cross-reference multiple portals' datasets
  • Proptech / real-estate diligence — pull permit, inspection, or code
  • Academic / policy research — bulk-export any Socrata dataset into a
  • Compliance monitoring — watch an inspections or recalls dataset for

Input

Paste this into the Apify Console, or send it as the run input over the API. Proxy settings are on by default; you rarely need to touch them.

FieldTypeRequiredWhat it does
targets array yes List of Socrata portal + dataset pairs to scrape. Each entry: {"portal_domain": "data.cityofnewyork.us", "dataset_id": "erm2-nwe9", "soql_where": "agency='NYPD'", "soql_select": null, "soql_order": null, "label":…
page_size integer no Internal $limit per page request to the Socrata API. Capped well under Socrata's documented ceiling, defensively.
max_items_per_target integer no Stop paging one target after this many rows. 0 means unlimited. Kept small in the prefill for a fast QA demo run -- raise it for a real run.
proxy_configuration object no Apify Proxy spec.
{
  "targets": [
    {
      "portal_domain": "data.cityofnewyork.us",
      "dataset_id": "erm2-nwe9",
      "soql_where": "agency='NYPD'",
      "label": "NYC 311"
    },
    {
      "portal_domain": "data.cityofchicago.org",
      "dataset_id": "ijzp-q8t2",
      "label": "Chicago crime"
    }
  ],
  "page_size": 1000,
  "max_items_per_target": 20,
  "proxy_configuration": {
    "useApifyProxy": true
  }
}

Output

One row per result, schema-validated before it is written. Export JSON, CSV, Excel or XML from the run, or read it over the API.

portal_domaindataset_idtarget_labelrecord_idscraped_atdata

{
  "portal_domain": "data.cityofnewyork.us",
  "dataset_id": "erm2-nwe9",
  "target_label": "NYC 311",
  "record_id": "46882077",
  "scraped_at": "2026-08-31T09:15:03.000Z",
  "data": {
    "unique_key": "46882077",
    "agency": "NYPD",
    "complaint_type": "Noise - Vehicle",
    "status": "Closed"
  }
}

Pricing

EventPriceWhen
Actor start$0.20Once per run, covers warm-up and proxy session setup.
Result row$0.0020Per result written to the dataset.

You pay only for results that land. Cap any run with maxTotalChargeUsd. See pricing & billing for worked examples.

FAQ

Do I need a Socrata account or API key?
No. Public Socrata datasets return data with no $app_token — this Actor runs entirely keyless.
What happens if I give it a bad `dataset_id`?
That target is logged and skipped; the run still finishes successfully and your other targets complete normally.
What if my `soql_where` filter matches nothing?
The run finishes successfully with zero rows for that target — an empty result is not an error.
Can I scrape any Socrata portal, or only NYC/Chicago?
Any Socrata portal — several hundred US city, county, and state governments run one. The prefill uses NYC and Chicago only to demonstrate multi-portal fan-out in a single run.
Why is `data` a raw untyped object instead of fixed columns?
Because the dataset is unknown at build time — a 311 feed and a crime feed share zero columns. Forcing them into one fixed schema would mean dropping real data; data keeps every column the source portal returned.

Ready to run it?

Open the listing on Apify, paste the input above, and watch rows land. If it ever breaks, it is our problem before it is yours.

Related Actors

Teams that run this also run