data.gov.sg
  • Introduction to data.gov.sg
  • ๐Ÿ†•What's new
    • Release Notes: Feburary 2025
    • Release Notes: October 2024
    • Release Notes: September 2024
  • USER GUIDE
    • Content quality guidelines
      • Data types
      • Data principles
    • For data consumers
      • How to search for data
      • How to raise a data request
      • How to embed the dataset explorer on your site
    • How to search for real-time APIs
    • For data owners
      • How to onboard as an admin
      • How to login
      • How to publish data
      • How to unpublish and/or delete datasets
      • How to edit datasets
      • How to generate API keys
      • Write APIs
  • DEVELOPER GUIDE
    • API overview
    • Collection APIs
    • Dataset APIs
Powered by GitBook
On this page

Was this helpful?

  1. DEVELOPER GUIDE

Collection APIs

PreviousAPI overviewNextDataset APIs

Last updated 10 months ago

Was this helpful?

Collections listing

This API returns a list of all the collections on data.gov.sg

Collection metadata

This API returns the metadata of a single collection and the datasets within it

To find the collectionId, refer to the URL of collection. For this collection: The collectionId is: 522

https://beta.data.gov.sg/collections/522/view

Get collections

get
Query parameters
pageinteger ยท min: 1Optional

Page number (optional, must be 1 or more)

Responses
200
Successful response
application/json
get
GET /v2/public/api/collections HTTP/1.1
Host: api-production.data.gov.sg
Accept: */*
200

Successful response

{
  "code": 1,
  "data": {
    "collections": [
      {
        "collectionId": "text",
        "createdAt": "2016-06-01T19:09:53+08:00",
        "name": "text",
        "description": "text",
        "lastUpdatedAt": "2016-06-01T19:09:53+08:00",
        "coverageStart": "2016-06-01T19:09:53+08:00",
        "coverageEnd": "2016-06-01T19:09:53+08:00",
        "frequency": "text",
        "sources": [
          "text"
        ],
        "managedByAgencyName": "text",
        "childDatasets": [
          "text"
        ]
      }
    ],
    "pages": 1
  },
  "errorMsg": "text"
}

Get metadata for a collection

get
Path parameters
collectionIdnumberRequired

The unique identifier of the collection (number)

Query parameters
withDatasetMetadatabooleanOptional

Include dataset metadata (true or false, default is false)

Responses
200
Successful response
application/json
get
GET /v2/public/api/collections/{collectionId}/metadata HTTP/1.1
Host: api-production.data.gov.sg
Accept: */*
200

Successful response

{
  "code": 1,
  "data": {
    "collectionMetadata": {
      "collectionId": "text",
      "createdAt": "2015-05-20T10:11:24+08:00",
      "name": "text",
      "description": "text",
      "lastUpdatedAt": "2020-06-26T12:19:29+08:00",
      "coverageStart": "2015-05-20T10:11:24+08:00",
      "coverageEnd": "2020-06-26T12:19:29+08:00",
      "frequency": "text",
      "sources": [
        "text"
      ],
      "managedBy": "text",
      "childDatasets": [
        "text"
      ]
    },
    "datasetMetadata": [
      {
        "datasetId": "text",
        "createdAt": "2015-05-21T14:10:45+08:00",
        "name": "text",
        "format": "text",
        "lastUpdatedAt": "2020-06-26T12:18:21+08:00",
        "managedBy": "text",
        "coverageStart": "2015-05-20T10:11:24+08:00",
        "coverageEnd": "2020-06-26T12:19:29+08:00"
      }
    ]
  },
  "errorMsg": "text"
}
  • Collections listing
  • GETGet collections
  • Collection metadata
  • GETGet metadata for a collection