query
Query a Socrata dataset using structured SoQL parameters or a raw SoQL string. Returns matched rows, row count, and truncation status.
Instructions
Query a dataset with structured SoQL parameters OR one raw SoQL string.
Structured mode (recommended): pass any of select/where/group/order/
limit/offset plus optional geo filters. Raw mode: pass soql only
(e.g. "SELECT offense, count(*) GROUP BY offense LIMIT 50").
Args: domain: Portal hostname, e.g. "data.seattle.gov". dataset_id: Socrata 4x4 id, e.g. "tazs-3rd5". select: Columns/expressions, e.g. ["offense", "count(*) as n"]. where: SoQL filter, e.g. "offense_date > '2026-06-01T00:00:00'". group: GROUP BY columns (pair with aggregate select expressions). order: e.g. "offense_date DESC". Defaults to ":id" for stable paging. limit: Max rows returned (default 100, hard cap applies). offset: Row offset for pagination. soql: Raw SoQL query — mutually exclusive with all structured params. within_circle: {field, lat, lon, radius_m} geo filter on a point column. within_box: {field, nw_lat, nw_lon, se_lat, se_lon} geo filter.
Returns:
{rows, row_count, truncated, query: {params, effective_limit, clamped}}.
truncated: true means more rows matched than were returned — narrow
the query or use export_csv for bulk extraction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| soql | No | ||
| group | No | ||
| limit | No | ||
| order | No | ||
| where | No | ||
| domain | Yes | ||
| offset | No | ||
| select | No | ||
| dataset_id | Yes | ||
| within_box | No | ||
| within_circle | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||