> ## 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

> Run a SoQL query against a Socrata dataset. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Run a SoQL query against a Socrata dataset.

<Info>
  Tool ID: `socrata_query_dataset`
</Info>

## Run this action

This action has conditional or dynamic input fields that cannot be represented by a reliable static example.

Inspect the live contract before executing it:

```bash theme={null}
deepline tools get socrata_query_dataset --json
```

## Example response

The static output schema is not detailed enough to generate a reliable example. Use `deepline tools get 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={null}
  {
    "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={null}
  {
    "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](/docs/providers/socrata/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
