Skip to content

API Cube RESTful

DeclanBuckley edited this page Dec 14, 2023 · 17 revisions

Home / API / Cube RESTful

This page contains the RESTful versions of the Cube methods. For the JSON-RPC methods, please go to the JSON-RPC page for Cube.

ReadCollection.

Returns a Collection of JsonStat items. Please refer to JSON-stat documentation for a full explanation of the structure: https://json-stat.org/format/.

Authentication: Anonymous

Privilege : N/A

Method: PxStat.Data.Cube_API.ReadCollection/{datefrom}/{language}

Parameters:

  • datefrom - The start date for any items in the collection. If not supplied, all live datasets are returned.
  • language - The preferred language of the metadata. If metadata is not found in this language, the metadata for the default language is returned. If no language is supplied, the default language is assumed.

Return: json

The Json format follows the JSON-Stat schema. Please refer to the JSON-stat documentation. An example (containing just one dataset) is shown below:

{
    "jsonrpc": "2.0",
    "data": {
        "class": "collection",
        "link": {
            "item": [
                {
                    "extension": {
                    "copyright": {
                        "name": "Central Statistics Office, Ireland",
                        "code": "CSO",
                        "href": "https://www.cso.ie"
                        },
                    "exceptional": true,
                    "language": {
                    "code": "en",
                    "name": "English"
                    },
                    "matrix": "SAPTHM4TBL4"
                    },
                    "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL4/JSON-stat/2.0/en",
                    "label": "Families by age of youngest child",
                    "link": {
                    "alternate": [
                    {
                    "type": "text/csv",
                    "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL4/CSV/1.0/en"
                    },
                    {
                    "type": "application/json",
                    "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL4/JSON-stat/1.0/en"
                    },
                    {
                    "type": "text/plain",
                    "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL4/PX/2013/en"
                    },
                   {
                   "type": "application/base64",
                   "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL4/XLSX/2007/en"
                   }
                   ]
                   },
                   "updated": "2020-01-22T14:54:39.680Z"
                   },
                   {
                   "extension": {
                   "copyright": {
                   "name": "Central Statistics Office, Ireland",
                   "code": "CSO",
                   "href": "https://www.cso.ie"
                   },
                   "exceptional": true,
                   "language": {
                   "code": "en",
                   "name": "English"
                   },
                   "matrix": "SAPTHM4TBL6"
                   },
                   "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL6/JSON-stat/2.0/en",
                   "label": "Females aged 20 years or over by number of children born",
                   "link": {
                   "alternate": [
                   {
                   "type": "text/csv",
                   "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL6/CSV/1.0/en"
                   },
                   {
                   "type": "application/json",
                   "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL6/JSON-stat/1.0/en"
                   },
                   {
                   "type": "text/plain",
                   "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL6/PX/2013/en"
                   },
                   {
                   "type": "application/base64",
                   "href": "https://dev-ws.cso.ie/public/api.restful/PxStat.Data.Cube_API.ReadDataset/SAPTHM4TBL6/XLSX/2007/en"
                   }
                   ]
                   },
                   "updated": "2020-01-23T9:36:48.480Z"
                   }
                   ]
                   },
                   "version": "2.0"
                   },
    "id": "2"
}

ReadDataset.

Reads a live dataset based on specific criteria. Please refer to JSON-stat documentation for a full explanation of the structure: https://json-stat.org/format/.

Authentication: Anonymous

Privilege : N/A

Method: PxStat.Data.Cube_API.ReadDataset/[matrix]/[format_type]/[format_version]/{language}

Parameters:

  • matrix - The matrix code of the requested dataset
  • format_type - The format type, i.e. one of PX,JSON-stat, CSV, XLSX
  • format_version - The version of the format_type
  • language - If no language is supplied, the default language is assumed.

**Return:** Data in format: `JSON-stat` or `PX` or `csv` or `xlsx` depending on the chosen `format` input parameter

ReadMetadata.

Reads the metadata for a live dataset based on specific criteria. Please refer to JSON-stat documentation for a full explanation of the structure: https://json-stat.org/format/.

Authentication: Anonymous

Privilege : N/A

Method: PxStat.Data.Cube_API.ReadMetadata/[matrix]/{language}

Parameters:

  • matrix - The matrix code of the requested dataset.
  • format_type - The format type, i.e. one of PX,JSON-stat, CSV, XLSX.
  • format_version - The version of the format_type.
  • language - If no language is supplied, the default language is assumed.

Return: Metadata in JSON-stat format.


Clone this wiki locally