NZ OIA/LGOIMA Calculator API

Calculate response deadlines for Official Information Act (OIA) and Local Government Official Information and Meetings Act (LGOIMA) requests using the NZ Ombudsman's calculator.

POST /calculate

Calculate the latest response date for an official information request.

Request Body:

{
  "date": "2025-01-15",
  "type": "OIA"
}

Parameters:

Example Response:

{
  "success": true,
  "data": {
    "response_date": "2025-02-15",
    "response_date_formatted": "15 February 2025",
    "considerations": [
      "This calculation assumes the request was received during business hours"
    ],
    "request_date": "2025-01-15",
    "request_type": "OIA"
  }
}

GET /health

Health check endpoint to verify the service is running.

Example Response:

{
  "status": "healthy",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "service": "OIA Calculator API"
}

Example Usage

curl

curl -X POST https://your-worker.workers.dev/calculate \
  -H "Content-Type: application/json" \
  -d '{"date": "2025-01-15", "type": "OIA"}'

JavaScript/fetch

const response = await fetch('https://your-worker.workers.dev/calculate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    date: '2025-01-15',
    type: 'OIA'
  })
});

const result = await response.json();
console.log('Response due by:', result.data.response_date, '(' + result.data.response_date_formatted + ')');

Error Responses

The API returns appropriate HTTP status codes:

Rate Limiting

Please be respectful when using this API. The service caches form data to minimize requests to the official Ombudsman website.

About

This API is a wrapper around the NZ Ombudsman's official calculator. It provides a programmatic interface to calculate response deadlines for official information requests.

Legal Notice: This is an unofficial service. Always verify important deadlines with the official Ombudsman calculator or seek legal advice for critical matters.