Stat-Xplore : Schema Endpoint

The /schema endpoint returns information about the Stat-Xplore datasets that are available to you, and their fields and measures.

Overview

Endpoint
https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema
HTTP Method GET

Request Headers

Accept-Language
The language that labels will be returned in (setting this is equivalent to changing the dataset and user interface language in Stat-Xplore). Optional. If not set, the server default language will be used.
APIKey
The API Key to use to authenticate this request. You can obtain your API key from the Account page in Stat-Xplore. Required in all requests.
If-None-Match
If you provide a known Etag value, then (if the response has not changed) this endpoint will return a 304 response instead of the response body. 304 responses do not count against your rate limit usage. Optional. If not set, the request will count against your rate limit usage.

Response Headers

X-RateLimit
The rate limit configured for this server, this is set to 2,000.
X-RateLimit-Remaining
The number of requests remaining for the current rate limiting period. If this value drops to 0 then you will not be able to submit any further requests using this API key until the limit resets.
X-RateLimit-Reset
The time when the rate limit will next be reset. This is expressed as a UNIX timestamp in milliseconds (the number of milliseconds since January 1st 1970).
Etag
The checksum of the response. You can store this and use it in the If-None-Match header in subsequent requests. This will allow you to check whether the resource has changed without affecting your rate limit.
Link

If the response returns a large number of child values then it may be subject to pagination (this occurs if there are over 100 child values). When the response is paginated, this header will contain a link to the next page of results.

If this header is not returned then this indicates either that the response was not paginated, or that the current response contains the last page of results.

Response Body

The root endpoint, /schema, returns details of all datasets and folders at the root level of Stat-Xplore. For example, the following response indicates that there are thirteen folders installed at the root level that you have permission to access: Attendance Allowance, Benefit Cap, Carer's Allowance, Disability Living Allowance, Employment and Support Allowance, Housing Benefit, NINo Registrations, Pension Credit, Personal Independence Payment, Sanction Decisions, State Pension, Universal Credit and Work Programme.

{
  "id": "str:folder:root",
  "label": "Stat-Xplore Tables",
  "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Aroot",
  "type": "FOLDER",
  "children": [
    {
      "id": "str:folder:faa",
      "label": "Attendance Allowance",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afaa",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fbc",
      "label": "Benefit Cap",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afbc",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fca",
      "label": "Carers Allowance",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afca",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fdla",
      "label": "Disability Living Allowance",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afdla",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fesa",
      "label": "Employment and Support Allowance",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afesa",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fhb",
      "label": "Housing Benefit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afhb",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fNINO",
      "label": "NINO Registrations",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3AfNINO",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fpc",
      "label": "Pension Credit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afpc",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fpip",
      "label": "Personal Independence Payment",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afpip",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fsanc",
      "label": "Sanction Decisions",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afsanc",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fsp",
      "label": "State Pension",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afsp",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fuc",
      "label": "Universal Credit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afuc",
      "type": "FOLDER"
    },
    {
      "id": "str:folder:fwp",
      "label": "Work Programme",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afwp",
      "type": "FOLDER"
    }
  ]
}

As shown by this example, each object that is described in the response has a unique ID that begins with str:. You can append this to the URL to obtain more details about that object. For example, querying /schema/str:folder:fuc returns what databases are contained in the Universal Credit folder:

{
  "id": "str:folder:fuc",
  "label": "Universal Credit",
  "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Afolder%3Afuc",
  "type": "FOLDER",
  "children": [
    {
      "id": "str:database:UC_Claims",
      "label": "Claims made to Universal Credit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Adatabase%3AUC_Claims",
      "type": "DATABASE"
    },
    {
      "id": "str:database:UC_Households",
      "label": "Households on Universal Credit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Adatabase%3AUC_Households",
      "type": "DATABASE"
    },
    {
      "id": "str:database:UC_Monthly",
      "label": "People on Universal Credit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Adatabase%3AUC_Monthly",
      "type": "DATABASE"
    },
    {
      "id": "str:database:UC_Starts",
      "label": "Starts to Universal Credit",
      "location": "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/schema/str%3Adatabase%3AUC_Starts",
      "type": "DATABASE"
    }}
  ]
}

We can then take a further look into the database to find out what variables are contained inside. To do this simply change the unique ID ending to the corresponding database ID.