---
title: "Get fields for a dataset"
method: GET
path: "/datasets/{dataset-id}/fields"
tags: ["datasets", "fields"]
---

# Get fields for a dataset

`GET /datasets/{dataset-id}/fields`

## Request

- Base URL: `https://api.mopinion.com`
- URL: `https://api.mopinion.com/datasets/{dataset-id}/fields`
- Auth: none declared

## Path parameters

- `dataset-id` integer, required

## Headers

- `version` string

## Response `200`

Get fields for the given dataset

- Field[]
  - `report_id` integer: Report identifier
  - `dataset_id` integer: Dataset identifier
  - `label` string: Full field label
  - `short_label` string: Short version of the field label
  - `key` string: Field identifier
  - `type` string: Field variable type
  - `group_key` string: Name of the question group the field belongs to
  - `answer_options` object: (optional) additional properties

## Other responses

- `400`: Dataset id not set
- `401`: Unauthorized
- `404`: Dataset not found

---

[API](https://skmtc.dev/mopinion/apis/mopinion-data-api.md) · [All operations](https://skmtc.dev/mopinion/apis/mopinion-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mopinion/apis/mopinion-data-api/revisions/82d3a0e3a454?raw)
