Get Dataset Schema
socrata_get_datasetFetch full metadata and column schema for a Socrata dataset by ID. Returns field names, data types, descriptions, row count, and licensing. Always call this before writing a socrata_query_dataset — the column types determine correct WHERE clause syntax: Number columns accept bare literals (year=2023) while Text columns require single-quoted strings (year='2023').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | No | Portal domain (e.g. data.seattle.gov). Defaults to SOCRATA_DEFAULT_DOMAIN env var or data.seattle.gov. | |
| dataset_id | Yes | Four-by-four dataset ID matching pattern like kzjm-xkqj. Obtain from socrata_find_datasets. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Dataset display name. | |
| tags | No | Associated tags. | |
| error | No | Present when the call failed. Absent on success. | |
| domain | No | Portal domain hosting this dataset. | |
| columns | No | Column schema. Computed region columns (:@computed_region_*) are excluded to reduce noise. | |
| license | No | License name when available. | |
| category | No | Domain category when available. | |
| row_count | No | Approximate row count when available. See row_count_source for provenance. | |
| dataset_id | No | Four-by-four dataset ID. | |
| description | No | Dataset description when available. | |
| data_updated_at | No | ISO 8601 timestamp of last data update when available. | |
| row_count_source | No | How row_count was obtained: 'top_level_cached_contents' — reported directly by the portal's views metadata; 'column_cached_contents' — derived as the maximum per-column cached count when the top-level value is absent. Absent when row_count is absent. |