---
title: "Dataset view metadata"
method: GET
path: "/api/v1/socrata/{portal}/metadata/{dataset_id}"
tags: ["Public Finance & Government"]
---

# Dataset view metadata

`GET /api/v1/socrata/{portal}/metadata/{dataset_id}`

Full view metadata via `api/views/{dataset_id}.json` - display title, description, owner, columns, tags, category, license, row and view counts, plus the `rowsUpdatedAt` and `viewLastModified` Unix-epoch timestamps Sugra uses for `data_time`.

## Path parameters

- `portal` string, required — Portal slug (e.g. `nyc`).
- `dataset_id` string, required — Socrata 4-4 hex dataset identifier (e.g. `erm2-nwe9`).

## Response `200`

Dataset view metadata with embedded columns and upstream freshness timestamps.

- EnvelopeSocrataMetadataPayload
  - `data` SocrataMetadataPayload, required — Response payload for `/api/v1/socrata/{portal}/metadata/{dataset_id}`.
    - `portal` string, required — Portal slug used for this query.
    - `domain` string, required — Portal hostname.
    - `dataset_id` string, required — 4-4 hex dataset identifier.
    - `dataset` SocrataDataset, required — Full dataset (view) metadata from `/api/views/{id}.json`. Surface matches the upstream Socrata Views API. Many fields are optional because agencies publish heterogeneous metadata.
      - `id` string, nullable — 4-4 hex dataset identifier (e.g. `erm2-nwe9`).
      - `name` string, nullable — Dataset display title.
      - `attribution` string, nullable — Publishing agency or author attribution string.
      - `attributionLink` string, nullable — Canonical URL for the publishing agency or dataset home.
      - `averageRating` number, nullable — Portal-wide average user rating (0.0 to 100.0).
      - `category` string, nullable — Domain category assigned by the publisher (e.g. `Health`, `Transportation`).
      - `createdAt` integer, nullable — Unix epoch seconds - dataset creation time.
      - `description` string, nullable — Plain-text dataset description.
      - `descriptionMarkdown` string, nullable — Markdown-rendered description when the publisher provides a richer body.
      - `displayType` string, nullable — Dataset display type (`table`, `map`, `chart`, `blob`, `filter`).
      - `domainCName` string, nullable — Portal hostname that owns the dataset.
      - `downloadCount` integer, nullable — Number of downloads recorded by the portal.
      - `hideFromCatalog` boolean, nullable — True if the dataset is hidden from catalog search.
      - `hideFromDataJson` boolean, nullable — True if the dataset is excluded from data.json syndication.
      - `indexUpdatedAt` integer, nullable — Unix epoch seconds of last search-index refresh.
      - `newBackend` boolean, nullable — True when the dataset runs on Socrata's new backend.
      - `numberOfComments` integer, nullable — Comment count on the upstream portal.
      - `oid` integer, nullable — Numeric object ID.
      - `provenance` string, nullable — Provenance label - `official` or `community`.
      - `publicationAppendEnabled` boolean, nullable — True when the dataset accepts appended rows via the publication workflow.
      - `publicationDate` integer, nullable — Unix epoch seconds - initial publication.
      - `publicationGroup` integer, nullable — Socrata publication group identifier.
      - `publicationStage` string, nullable — Publication stage (e.g. `published`, `unpublished`).
      - `rowClass` string, nullable — Row class label from the view definition.
      - `rowsUpdatedAt` integer, nullable — Unix epoch seconds of last row-level refresh - preferred source of `data_time`.
      - `rowsUpdatedBy` string, nullable — User ID of the last-row-updating account.
      - `tableId` integer, nullable — Underlying table identifier.
      - `totalTimesRated` integer, nullable — Number of user ratings submitted on upstream.
      - `viewCount` integer, nullable — Total view count on the upstream portal.
      - `viewLastModified` integer, nullable — Unix epoch seconds of last view (schema-level) modification - fallback for `data_time`.
      - `viewType` string, nullable — View type (e.g. `tabular`, `blob`, `href`, `dataset`).
      - `columns` SocrataColumn[], nullable — Embedded column definitions when included by upstream.
        - `id` integer, nullable — Column numeric ID on the upstream view.
        - `name` string, nullable — Display name of the column as shown in the portal UI.
        - `fieldName` string, nullable — SoQL machine name - the identifier to use in `$select`, `$where`, `$order`. Column names with spaces or special characters should be back-quoted in SoQL.
        - `dataTypeName` string, nullable — Upstream-declared column type (e.g. `number`, `text`, `calendar_date`, `point`, `checkbox`).
        - `description` string, nullable — Author-declared column description.
        - `position` integer, nullable — Column position (1-based) in the default row ordering.
        - `renderTypeName` string, nullable — Socrata render type label used for UI presentation.
        - `tableColumnId` integer, nullable — Internal table column identifier.
        - `width` integer, nullable — Upstream column width hint (pixels).
        - `format` object, nullable — Upstream-declared format hints (alignment, precision, view options).
        - `cachedContents` object, nullable — Cached value summary from upstream - top/min/max/avg, null counts, cardinality. Optional and agency-dependent.
      - `metadata` object, nullable — Publisher-defined metadata block (`custom_fields`, `rdfSubject`, `attachments`).
      - `owner` object, nullable — Dataset owner record (display name, profile image, organization).
      - `query` object, nullable — SoQL query definition when the view is derived / filtered.
      - `rights` string[], nullable — Access rights list (e.g. `read`).
      - `tags` string[], nullable — Free-form tags set by the publishing agency.
      - `flags` string[], nullable — Socrata dataset flags (e.g. `default`, `restorePossibleForType`).
      - `license` object, nullable — License record - name, URL, terms.
      - `licenseId` string, nullable — License identifier as assigned on the portal.
      - `dataQuality` object, nullable — Data-quality attributes when surfaced by the agency.
  - `meta` SugraMeta, required — Metadata attached to every /api/v1/* response envelope.
    - `endpoint` string, required — Requested endpoint path.
    - `data_time` string, required — ISO 8601 UTC timestamp of the source data, not of the request.
    - `response_time` string, required — ISO 8601 UTC timestamp when this response was produced.
    - `provider` string, required — API name and version.
    - `source` string, nullable — Identifier of the primary upstream source used for this response.
    - `attribution` string, nullable — Human-readable attribution mandated by an upstream source (e.g. a securities regulator or self-regulatory organization). Present only on responses whose source requires the owner and source to be clearly identified. Do not remove or alter it when using the response.
    - `fallback_used` boolean, nullable — True when the primary source failed and a fallback produced the data.
    - `fallback_chain` string[], nullable — Ordered list of sources attempted, in the order they were tried.
    - `cached` boolean, nullable — True when this response was served from the internal cache.
    - `stale` boolean, nullable — True when the cached response was returned after the upstream rate-limited or errored. Clients can use this to detect degraded data.

## Other responses

- `401` — Missing or invalid `x-api-key` header. JSON body with a stable `code` distinguishing `missing_api_key` (no header sent) from `invalid_api_key` (header sent, key not accepted); any other 401 source carries the generic `unauthorized` with its detail as `reason`. Plus `hint`. `plan` is always null on 401 - an unauthenticated request has no plan; quota exhaustion is 429, not 401.
- `422` — Validation Error
- `429` — Daily rate limit exceeded. Check `X-RateLimit-Reset` for the next window.
- `503` — Upstream source is temporarily unavailable. Retry after a short delay.

---

[API](https://skmtc.net/sugra/apis/sugra-api.md) · [All operations](https://skmtc.net/sugra/apis/sugra-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sugra/sugra-api/versions/d3e3d9c28132/schema)
