limit
In order to manage server load, it is possible to impose an upper limit on the limit
parameter for the info
and dataset
endpoints. The limit
endpoint will simply return the value that has been set, or else null
if there is no limit.
Usage
GET
/v1/limit
{
"series_limit_csv": 50,
"series_limit_json": 100
}
subjects
List available subjects.
Parameters
Parameter | Optional | Multiple | Description |
---|---|---|---|
format |
✔ | ✗ | Output format. One of CSV or JSON . Defaults to JSON . |
subjectCode |
✔ | ✗ | Subject code. For example, HLF , LCI , BOP , CPI , etc. |
subjectKeyword |
✔ | ✔ | Search term for subject. |
Usage
The basic format is:
GET
/v1/subjects?format=json&subjectCode=value&subjectKeyword=value&subjectKeyword=value&...
For example:
GET
/v1/subjects?format=json&subjectCode=HLF
[
{
"subject_code": "HLF",
"title_text": "Household Labour Force Survey - HLF"
}
]
or:
GET
/v1/subjects?format=json&subjectKeyword=Labour
[
{
"subject_code": "HLF",
"title_text": "Household Labour Force Survey - HLF"
},
{
"subject_code": "LCI",
"title_text": "Labour Cost Index - LCI"
}
]
families
List available families.
Parameters
Parameter | Optional | Multiple | Description |
---|---|---|---|
format |
✔ | ✗ | Output format. One of CSV or JSON . Defaults to JSON . |
subjectCode |
✔ | ✗ | Subject code. For example, HLF , LCI , BOP , CPI , etc. |
familyCode |
✔ | ✗ | Family code. For example, SA . |
familyNbr |
✔ | ✗ | Family number. |
subjectKeyword |
✔ | ✔ | Search term for subject. |
familyKeyword |
✔ | ✔ | Search term for family. |
Usage
The basic format is:
GET
/v1/families?format=json&subjectCode=value&familyCode=value&familyNbr=value&subjectKeyword=value&subjectKeyword=value&...&familyKeyword=value&familyKeyword=value&...
For example:
GET
/v1/families?format=json&subjectCode=HLF&familyCode=SA
[
{
"subject_code": "HLF",
"family_code": "SA",
"family_nbr": 7,
"title_text": "Persons Employed, Unemployed, Not in Labour Force by Sex by Age Group"
},
{
"subject_code": "HLF",
"family_code": "SA",
"family_nbr": 4327,
"title_text": "SA - Labour Force Status by Sex by Age Group - Sampling Errors"
}
]
or:
GET
/v1/families?format=json&familyKeyword=building&familyKeyword=region
[
{
"subject_code": "BAS",
"family_code": "SA",
"family_nbr": 4682,
"title_text": "Building activity by region"
},
{
"subject_code": "BLD",
"family_code": "SF",
"family_nbr": 4686,
"title_text": "Building consents by region"
}
]
info
Description of available time series.
Parameters
Parameter | Optional | Multiple | Description |
---|---|---|---|
format |
✔ | ✗ | Output format. One of CSV , or JSON . Defaults to JSON . |
subjectCode |
✔ | ✔ | Subject code. For example, HLF , LCI , BOP , CPI , etc. |
familyCode |
✔ | ✔ | Family code. For example, SA . |
familyNbr |
✔ | ✔ | Family number. |
seriesCode |
✔ | ✔ | Series code. For example, HLFQ.SAA1AZ . |
subjectKeyword |
✔ | ✔ | Search term for subject. |
familyKeyword |
✔ | ✔ | Search term for family. |
seriesKeyword |
✔ | ✔ | Search term for series. |
interval |
✔ | ✗ | Interval. 1 denotes monthly, 3 denotes quarterly, and 12 denotes annual. |
offset |
✔ | ✗ | Offset month. For example, 3 denotes the March quarter for quartely data. |
limit |
✔ | ✗ | Series limit. Limits the number of results returned. |
drop |
✔ | ✗ | Used in conjunction with limit to access results in batches. For example, setting limit to 100 and drop to 100 would yield results 101 through 200. |
Usage
The basic format is:
GET
/v1/info?format=json&subjectCode=value&subjectCode=value&...&familyCode=value&familyCode=value&...&familyNbr=value&familyNbr=value&...&seriesCode=value&seriesCode=value&...&subjectKeyword=value&subjectKeyword=value&...&familyKeyword=value&familyKeyword=value&...&seriesKeyword=value&seriesKeyword=value&...&interval=value&offset=value&limit=value&drop=value
For example:
GET
/v1/info?format=json&subjectCode=HLF&familyCode=SA&familyNbr=7&seriesKeyword=employment%20rate&seriesKeyword=female&seriesKeyword=15-19&interval=3
[
{
"subject_code": "HLF",
"family_code": "SA",
"family_nbr": 7,
"series_code": "HLFQ.SAF2AA",
"series_nbr": 2059,
"subject_title": "Household Labour Force Survey - HLF",
"family_title": "Persons Employed, Unemployed, Not in Labour Force by Sex by Age Group",
"interval": 3,
"offset": 3,
"magnitude": 0,
"unit": "Percent",
"variables": [
"Persons Employed, Unemployed, Not in Labour Force (for current quarter)",
"Sex",
"Age Group"
],
"outcomes": [
"Unemployment Rate",
"Female",
"Aged 15-19 Years"
]
},
{
"subject_code": "HLF",
"family_code": "SA",
"family_nbr": 7,
"series_code": "HLFQ.SAH2AA",
"series_nbr": 3099244,
"subject_title": "Household Labour Force Survey - HLF",
"family_title": "Persons Employed, Unemployed, Not in Labour Force by Sex by Age Group",
"interval": 3,
"offset": 3,
"magnitude": 0,
"unit": "Percent",
"variables": [
"Persons Employed, Unemployed, Not in Labour Force (for current quarter)",
"Sex",
"Age Group"
],
"outcomes": [
"Employment Rate",
"Female",
"Aged 15-19 Years"
]
}
]
count
Count individual time series.
Parameters
Parameter | Optional | Multiple | Description |
---|---|---|---|
format |
✔ | ✗ | Output format. One of CSV , or JSON . Defaults to JSON . |
subjectCode |
✔ | ✔ | Subject code. For example, HLF , LCI , BOP , CPI , etc. |
familyCode |
✔ | ✔ | Family code. For example, SA . |
familyNbr |
✔ | ✔ | Family number. |
seriesCode |
✔ | ✔ | Series code. For example, HLFQ.SAA1AZ . |
subjectKeyword |
✔ | ✔ | Search term for subject. |
familyKeyword |
✔ | ✔ | Search term for family. |
seriesKeyword |
✔ | ✔ | Search term for series. |
interval |
✔ | ✗ | Interval. 1 denotes monthly, 3 denotes quarterly, and 12 denotes annual. |
offset |
✔ | ✗ | Offset month. For example, 3 denotes the March quarter for quartely data. |
Usage
The basic format is:
GET
/v1/count?format=json&subjectCode=value&subjectCode=value&...&familyCode=value&familyCode=value&...&familyNbr=value&familyNbr=value&...&seriesCode=value&seriesCode=value&...&subjectKeyword=value&subjectKeyword=value&...&familyKeyword=value&familyKeyword=value&...&seriesKeyword=value&seriesKeyword=value&...&interval=value&offset=value
For example:
GET
/v1/count?format=json&subjectCode=HLF
22867
series
Time series data by identifier.
Parameters
Parameter | Optional | Multiple | Description |
---|---|---|---|
format |
✔ | ✗ | Output format. One of CSV , JSON , or CHART . CHART produces a highchart. Defaults to JSON . |
seriesCode |
✔ | ✔ | Series identifier. For example, HLFQ.SAA1AZ . |
start |
✔ | ✗ | Start date. For example, 1986.03 . |
end |
✔ | ✗ | End date. For example, 2018.12 . |
head |
✔ | ✗ | How many values at the head of each series to keep. |
tail |
✔ | ✗ | How many values at the tail of each series to keep. |
title |
✔ | ✗ | A title to be used if selected format is CHART . |
Usage
The basic format is:
GET
/v1/series?format=json&seriesCode=value&seriesCode=value&...&start=value&end=tail&head=value&tail=value
For example:
GET
/v1/series?format=json&seriesCode=HLFQ.SAA1AZ&seriesCode=HLFQ.SAA2AZ&start=2017.03
[
{
"subject_code": "HLF",
"subject_title": "Household Labour Force Survey - HLF",
"family_code": "SA",
"family_nbr": 7,
"family_title": "Persons Employed, Unemployed, Not in Labour Force by Sex by Age Group",
"series_code": "HLFQ.SAA1AZ",
"series_nbr": 1878,
"interval": 3,
"magnitude": 3,
"offset": 3,
"units": "Number",
"variables": [
"Persons Employed, Unemployed, Not in Labour Force (for current quarter)",
"Sex",
"Age Group"
],
"outcomes": [
"Persons Employed in Labour Force",
"Male",
"Total All Ages"
],
"period": [
"2017.03",
"2017.06",
"2017.09",
"2017.12",
"2018.03",
"2018.06",
"2018.09",
"2018.12"
],
"value": [
1352,
1341.7,
1360.1,
1381.7,
1387.1,
1381.1,
1388.1,
1392.1
],
"status": [
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL"
]
},
{
"subject_code": "HLF",
"subject_title": "Household Labour Force Survey - HLF",
"family_code": "SA",
"family_nbr": 7,
"family_title": "Persons Employed, Unemployed, Not in Labour Force by Sex by Age Group",
"series_code": "HLFQ.SAA2AZ",
"series_nbr": 1890,
"interval": 3,
"magnitude": 3,
"offset": 3,
"units": "Number",
"variables": [
"Persons Employed, Unemployed, Not in Labour Force (for current quarter)",
"Sex",
"Age Group"
],
"outcomes": [
"Persons Employed in Labour Force",
"Female",
"Total All Ages"
],
"period": [
"2017.03",
"2017.06",
"2017.09",
"2017.12",
"2018.03",
"2018.06",
"2018.09",
"2018.12"
],
"value": [
1195,
1188.8,
1214.6,
1237.8,
1239.3,
1242.3,
1259.8,
1252
],
"status": [
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL",
"FINAL"
]
}
]
or (and note that the chart
format is a very minimal implementation, for illustrative purposes only):
GET
/v1/series?format=chart&seriesCode=HLFQ.SAA3AZ&seriesCode=HLFQ.S1A3S&seriesCode=HLFQ.S4A3S&tail=12
dataset
Time series data.
Parameters
Parameter | Optional | Multiple | Description |
---|---|---|---|
format |
✔ | ✗ | Output format. One of CSV , or JSON . Defaults to JSON . |
subjectCode |
✔ | ✔ | Subject code. For example, HLF , LCI , BOP , CPI , etc. |
familyCode |
✔ | ✔ | Family code. For example, SA . |
familyNbr |
✔ | ✔ | Family number. |
seriesCode |
✔ | ✔ | Series code. For example, HLFQ.SAA1AZ . |
subjectKeyword |
✔ | ✔ | Search term for subject. |
familyKeyword |
✔ | ✔ | Search term for family. |
seriesKeyword |
✔ | ✔ | Search term for series. |
interval |
✔ | ✗ | Interval. 1 denotes monthly, 3 denotes quarterly, and 12 denotes annual. |
offset |
✔ | ✗ | Offset month. For example, 3 denotes the March quarter for quartely data. |
limit |
✔ | ✗ | Series limit. Limits the number of results returned. |
drop |
✔ | ✗ | Used in conjunction with limit to access results in batches. For example, setting limit to 100 and drop to 100 would yield results 101 through 200. |
head |
✔ | ✗ | How many values at the head of each series to keep. |
tail |
✔ | ✗ | How many values at the tail of each series to keep. |
Example requests
The basic format is:
GET
/v1/dataset?format=json&subjectCode=value&subjectCode=value&...&familyCode=value&familyCode=value&...&familyNbr=value&familyNbr=value&...&seriesCode=value&seriesCode=value&...&subjectKeyword=value&subjectKeyword=value&...&familyKeyword=value&familyKeyword=value&...&seriesKeyword=value&seriesKeyword=value&...&interval=value&offset=value&limit=value&drop=value&head=value&tail=value
For example:
GET
/v1/dataset?format=json&subjectCode=HLF&familyCode=SA&seriesKeyword=15-19&seriesKeyword=Female&seriesKeyword=Unemployed&tail=4
[
{
"subject_code": "HLF",
"subject_title": "Household Labour Force Survey - HLF",
"family_code": "SA",
"family_nbr": 7,
"family_title": "Persons Employed, Unemployed, Not in Labour Force by Sex by Age Group",
"series_code": "HLFQ.SAB2AA",
"series_nbr": 1915,
"interval": 3,
"magnitude": 3,
"offset": 3,
"units": "Number",
"variables": [
"Persons Employed, Unemployed, Not in Labour Force (for current quarter)",
"Sex",
"Age Group"
],
"outcomes": [
"Persons Unemployed in Labour Force",
"Female",
"Aged 15-19 Years"
],
"period": [
"2018.03",
"2018.06",
"2018.09",
"2018.12"
],
"value": [
13.9,
12.9,
9.5,
13
],
"status": [
"FINAL",
"FINAL",
"FINAL",
"FINAL"
]
},
{
"subject_code": "HLF",
"subject_title": "Household Labour Force Survey - HLF",
"family_code": "SA",
"family_nbr": 4327,
"family_title": "SA - Labour Force Status by Sex by Age Group - Sampling Errors",
"series_code": "HLFQ.SASEB2AA",
"series_nbr": 3265428,
"interval": 3,
"magnitude": 3,
"offset": 3,
"units": "Number",
"variables": [
"Sampling Errors",
"Persons Employed, Unemployed, Not in Labour Force (for current quarter)",
"Sex",
"Age Group"
],
"outcomes": [
"Sampling errors",
"Persons Unemployed in Labour Force",
"Female",
"Aged 15-19 Years"
],
"period": [
"2018.03",
"2018.06",
"2018.09",
"2018.12"
],
"value": [
2.9,
2.6,
2.5,
2.6
],
"status": [
"FINAL",
"FINAL",
"FINAL",
"FINAL"
]
}
]