Read rows from a New Zealand public dataset.
PreviewNew Zealand1 credit
What it does
Read rows from a licensed data.govt.nz DataStore table, with exact field filtering, column selection and sorting.
Ask your AI
Read rows from a New Zealand public dataset. Ask me for any detail you need first, then show the result with its source and date, and list anything a person should check.
What comes back
Costs one credit per query.
Good to know
- Costs one credit per query.
- Use nz_dataset_search or nz_dataset_get with detail=full first to confirm that the resource is DataStore active.
- Supports exact field filters, selected columns and up to three sort fields for up to 100 rows.
For developers
| Tool ID | nz_dataset_query |
|---|---|
| Server | New Zealand |
| Credit behaviour | 1 credit |
Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dataset_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Exact dataset id or slug from nz_dataset_search or nz_dataset_get."
},
"resource_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Exact resource id listed by nz_dataset_get with detail=full."
},
"filters": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"maxItems": 50,
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
}
]
}
},
"fields": {
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"sort": {
"maxItems": 3,
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"direction": {
"default": "asc",
"type": "string",
"enum": [
"asc",
"desc"
]
}
},
"required": [
"field",
"direction"
],
"additionalProperties": false
}
},
"limit": {
"default": 20,
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": [
"dataset_id",
"resource_id",
"limit"
],
"additionalProperties": false
}Shared output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"summary": {
"type": "string"
},
"data": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"executionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"creditsCharged": {
"type": "number",
"minimum": 0
},
"usage": {
"type": "object",
"properties": {
"credits_charged": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"credits_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"credits_charged"
],
"additionalProperties": false
}
},
"required": [
"summary",
"data",
"creditsCharged"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
}
},
"required": [
"code",
"message",
"retryable"
],
"additionalProperties": false
},
"usage": {
"type": "object",
"properties": {
"credits_charged": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"credits_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"credits_charged"
],
"additionalProperties": false
}
},
"required": [
"error"
],
"additionalProperties": false
}
]
}