# Get dataset metadata

{% hint style="info" %}
To find the dataset\_id, refer to the URL of dataset.\
\
For this dataset:\
<https://data.gov.sg/collections/522/datasets/d_11e68bba3b3c76733475a72d09759eeb/view> \
or \
<https://data.gov.sg/datasets/d_11e68bba3b3c76733475a72d09759eeb/view>\
\
\
The datasetId is:\
`d_11e68bba3b3c76733475a72d09759eeb`\ <br>

For staging, note that the dataset\_id might differ between staging and production:

* Domain: [https://api-staging.data.gov.sg/](https://api-staging.data.gov.sg/v2/public/api/datasets/d_696c994c50745b079b3684f0e90ffc53/list-rows)
* Example: [https://api-staging.data.gov.sg/v2/public/api/datasets/{datasetId}/metadata](https://api-production.data.gov.sg/v2/public/api/datasets/{datasetId}/metadata)
  {% endhint %}

### Dataset Metadata

This API returns the metadata of a single dataset

## GET /v2/public/api/datasets/{datasetId}/metadata

> Get metadata for a dataset

```json
{"openapi":"3.0.3","info":{"title":"beta.data.gov.sg Public API","version":"1.0.11"},"tags":[{"name":"datasets"}],"servers":[{"url":"https://api-production.data.gov.sg"}],"paths":{"/v2/public/api/datasets/{datasetId}/metadata":{"get":{"summary":"Get metadata for a dataset","tags":["datasets"],"parameters":[{"in":"path","name":"datasetId","required":true,"schema":{"type":"string"},"description":"The unique identifier of the dataset"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"data":{"type":"object","properties":{"datasetId":{"type":"string"},"createdAt":{"type":"string"},"name":{"type":"string"},"format":{"type":"string"},"lastUpdatedAt":{"type":"string"},"managedBy":{"type":"string"},"coverageStart":{"type":"string"},"coverageEnd":{"type":"string"},"columnMetadata":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"}},"map":{"type":"object","additionalProperties":{"type":"string"}},"metaMapping":{"type":"object","additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"columnTitle":{"type":"string"},"dataType":{"type":"integer"},"index":{"type":"string"}}}}}}}},"errorMsg":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.data.gov.sg/developer-guide/dataset-apis/get-dataset-metadata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
