> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Socrata Open Data: Socrata Query Dataset

> Query a government open-data dataset by portal domain and dataset ID, with SQL-like filters, grouping and sorting. Includes SDK V2 examples, schemas, and cost.

Query a government open-data dataset by portal domain and dataset ID, with SQL-like filters, grouping and sorting.

> [!NOTE]
>
> Tool ID: `socrata_query_dataset`

## Run this action

This action has conditional or dynamic inputs. A static example cannot describe these inputs reliably.

Read the live contract before you execute this action:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline describe socrata_query_dataset --json
```

## Example response

The static output schema lacks the details for a reliable example. Use `deepline describe socrata_query_dataset --json` for the complete live contract.

## Input reference

Run a SoQL query against a Socrata dataset

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.datasetId` | `string` | Yes | — | Pattern: `^[a-z0-9]&#123;4&#125;-[a-z0-9]&#123;4&#125;$`. |
| `payload.domain` | `string` | Yes | — | Socrata host for this dataset, e.g. `data.cityofnewyork.us`. Routed at runtime. Not sent upstream as a query parameter. |
| `payload.$select` | `string` | No | — | SoQL SELECT clause, e.g. `borough,issuance_date` or `count(*)`. |
| `payload.$where` | `string` | No | — | SoQL WHERE clause, e.g. `borough='BRONX' AND issuance_date &gt; '2026-01-01'`. |
| `payload.$order` | `string` | No | — | SoQL ORDER BY clause. Defaults to `:id` when omitted, because Socrata does not guarantee stable row order across pages without one. paging an unordered query silently duplicates and skips rows. |
| `payload.$group` | `string` | No | — | — |
| `payload.$having` | `string` | No | — | — |
| `payload.$q` | `string` | No | — | Full-text search across the dataset. |
| `payload.$limit` | `integer` | No | `1000` | Rows per request, capped at 50000. Socrata itself accepts arbitrarily large values and will stream hundreds of megabytes in a single 200 response, so this cap is enforced client-side. Minimum: 1. Maximum: 50000. |
| `payload.$offset` | `integer` | No | `0` | Minimum: 0. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Run a SoQL query against a Socrata dataset",
    "properties": {
      "datasetId": {
        "type": "string",
        "pattern": "^[a-z0-9]{4}-[a-z0-9]{4}$"
      },
      "domain": {
        "type": "string",
        "description": "Socrata host for this dataset, e.g. `data.cityofnewyork.us`. Routed at runtime; not sent upstream as a query parameter."
      },
      "$select": {
        "type": "string",
        "description": "SoQL SELECT clause, e.g. `borough,issuance_date` or `count(*)`."
      },
      "$where": {
        "type": "string",
        "description": "SoQL WHERE clause, e.g. `borough='BRONX' AND issuance_date > '2026-01-01'`."
      },
      "$order": {
        "type": "string",
        "description": "SoQL ORDER BY clause. Defaults to `:id` when omitted, because Socrata does not guarantee stable row order across pages without one; paging an unordered query silently duplicates and skips rows."
      },
      "$group": {
        "type": "string"
      },
      "$having": {
        "type": "string"
      },
      "$q": {
        "type": "string",
        "description": "Full-text search across the dataset."
      },
      "$limit": {
        "type": "integer",
        "description": "Rows per request, capped at 50000. Socrata itself accepts arbitrarily large values and will stream hundreds of megabytes in a single 200 response, so this cap is enforced client-side.",
        "default": 1000,
        "minimum": 1,
        "maximum": 50000
      },
      "$offset": {
        "type": "integer",
        "default": 0,
        "minimum": 0
      }
    },
    "required": [
      "datasetId",
      "domain"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `array` | Yes | — | Provider response payload. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "array",
        "description": "Provider response payload.",
        "items": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Socrata Open Data provider guide](https://deepline.com/docs/providers/socrata/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.