# Christchurch Alcohol Licences — New or Expiring (`spider355/nz-ccc-alcohol-licences`) Actor

New and expiring alcohol licences in Christchurch only, from the Council open-data layer. Trading name, address, type, issue date, and expiry date. US$0.005 per result. No licencee name. Not endorsed by Christchurch City Council. Exact CC BY 4.0 attribution is in the README.

- **URL**: https://apify.com/spider355/nz-ccc-alcohol-licences.md
- **Developed by:** [Mitchell](https://apify.com/spider355) (community)
- **Categories:** Lead generation, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Christchurch alcohol licences (Apify Actor)

New and expiring monitor for alcohol licences on the Christchurch City Council **Alcohol License Detail** open-data layer. It GETs the fixed ArcGIS FeatureServer query endpoint, keeps rows whose issue date or expiry date falls in the requested window, and writes an allowlisted dataset.

**This is a filtered extract, not the original feed.** `LicenceeName` is removed and geometry is omitted (no polygon, centroid, `Shape__Area`, or `Shape__Length`).

**Not endorsed by Christchurch City Council.** Do not use Council logos or trademarks. This Actor does not claim any endorsement beyond the disclaimer in the attribution line.

**Data source (only):** `https://gis.ccc.govt.nz/server/rest/services/OpenData/Regulatory/FeatureServer/9`

There is no URL input. `url`, `feedUrl`, `layerUrl`, and `outFields` are ignored. A process environment override `CCC_ALCOHOL_BASE_URL` is accepted only when it is `https://gis.ccc.govt.nz` and the path is this FeatureServer/9 layer (optional `/query`). Any other host or layer is rejected.

### Output fields

Each dataset item is an allowlist. `LicenceeName`, geometry, applicant, owner, email, phone, contact, and coordinates are never emitted. Emails and obvious phone numbers inside `TradingName`, `Address`, and `TypeofLicence` are replaced with `[redacted]`.

| Field | Description |
|-------|-------------|
| `vwAlcoholLicenseDetailID` | Layer object id |
| `TradingName` | Trading name (display field) |
| `Address` | Premises address string |
| `TypeofLicence` | Licence type |
| `IssuedDate` | Auckland calendar date `YYYY-MM-DD`, or null |
| `ExpiryDate` | Auckland calendar date `YYYY-MM-DD`, or null |
| `source` | The FeatureServer layer URL above |
| `attribution` | Exact line in Attribution below |

Dates on the layer are ArcGIS epoch milliseconds. This Actor converts them to Pacific/Auckland calendar dates. That formatting is not part of the attribution "Changes" sentence, which stays exact.

### Inputs

| Input | Notes |
|-------|--------|
| `mode` | `newOrExpiring` (default), `new`, or `expiring`. |
| `days` | Window length when a date pair is omitted. Default **90**. New: `IssuedDate` from Auckland today minus `days` through today. Expiring: `ExpiryDate` from today through today plus `days`. Research did not set this number. |
| `issuedFrom` / `issuedTo` | Optional inclusive `YYYY-MM-DD` pair for the new window. Overrides `days` for issue dates. |
| `expiryFrom` / `expiryTo` | Optional inclusive `YYYY-MM-DD` pair for the expiring window. Overrides `days` for expiry dates. |
| `maxItems` | Default **200**, cap **2000**. |

Null `IssuedDate` does not count as new. Null `ExpiryDate` does not count as expiring. The server `where` clause is the same window; rows are checked again locally before they are pushed.

Rows are sorted before the `maxItems` cut: `new` is newest `IssuedDate` first, `expiring` is soonest `ExpiryDate` first, and `newOrExpiring` keeps the smaller of (days from `IssuedDate` to the end of the issue window, days from the start of the expiry window to `ExpiryDate`) so an old expiry crowds out a new issue only when that expiry is more urgent. A run pages until the layer ends or **20** query GETs; `truncated` in the run log (not a dataset field) is true when the match count exceeds `maxItems`, or when that request cap or a repeated page stops the pull early. Each response body is capped at **8 MiB**. Queries send `returnGeometry=false` and `outFields` limited to the six layer attributes above (never `*`).

#### Try this

New licences only, for 30 days, capped at 5. Not the 90-day new-or-expiring window.

```json
{
  "mode": "new",
  "days": 30,
  "maxItems": 5
}
```

#### Query that worked

Probed 3 Oct 2026 (PT). `DATE` literals filter this layer. A small allowlisted page:

`returnGeometry=false&outFields=vwAlcoholLicenseDetailID,TradingName,Address,TypeofLicence,IssuedDate,ExpiryDate&resultRecordCount=2&orderByFields=vwAlcoholLicenseDetailID ASC&f=json`

`resultOffset` pages the layer (`maxRecordCount` 2000). This Actor uses page size 200 and pages by object id so offsets stay stable. Dataset order is the relevance sort above, not object id. Non-JSON, non-200, an ArcGIS `error` object, and an unexpected shape fail the run.

### Privacy

Rows are public premises fields plus the attribution line. `LicenceeName` is not requested, not stored, and not returned. This Actor does not join emails or phone numbers. If a free-text field contains one, it is replaced with `[redacted]`.

### Public records notice

- Data is as published on the Christchurch City Council open-data layer. It may lag the Council's licensing records or be incomplete. Check the official Council source (or the public notice or District Licensing Committee decision) before relying on a licence's status or dates.
- Corrections go to Christchurch City Council, not to this Actor.
- Use any personal information in the results lawfully, including under the Privacy Act 2020 and, for marketing contact, the Unsolicited Electronic Messages Act 2007.

### Attribution

Alcohol License Detail (OpenData) by Christchurch City Council. "CCC - Open Data - Use of this dataset is permitted in accordance with the Creative Commons Attribution 4.0 International (CC BY 4.0) License https://creativecommons.org/licenses/by/4.0/". Source: https://gis.ccc.govt.nz/server/rest/services/OpenData/Regulatory/FeatureServer/9. Changes: LicenceeName removed; geometry omitted. Christchurch City Council does not endorse this product.

This Actor emits a filtered extract (`LicenceeName` removed, geometry omitted), not the original feed. Christchurch City Council does not endorse this product.

### Known limits

- Christchurch City Council AlcoholLicenseDetail only. No other council and no other CCC layer.
- No licence status field on the layer, so applications and granted licences cannot be split.
- No geometry and no licencee name, by design.
- Default 90-day window is a product default. Research did not specify the number of days.

# Actor input Schema

## `mode` (type: `string`):

new = IssuedDate in the issued window. expiring = ExpiryDate in the expiry window. newOrExpiring = either (default).

## `days` (type: `integer`):

Used when an explicit date pair is omitted. New licences: IssuedDate from Auckland today minus days through today. Expiring licences: ExpiryDate from today through today plus days. Default 90. Research did not set a number.

## `issuedFrom` (type: `string`):

Optional inclusive IssuedDate start. Must be paired with issuedTo. Overrides days for the new window. Fails the run if set while mode is expiring.

## `issuedTo` (type: `string`):

Optional inclusive IssuedDate end. Must be paired with issuedFrom.

## `expiryFrom` (type: `string`):

Optional inclusive ExpiryDate start. Must be paired with expiryTo. Overrides days for the expiring window.

## `expiryTo` (type: `string`):

Optional inclusive ExpiryDate end. Must be paired with expiryFrom.

## `maxItems` (type: `integer`):

Cap on dataset items. Default 200, maximum 2000.

## Actor input object example

```json
{
  "mode": "newOrExpiring",
  "days": 90,
  "maxItems": 200
}
```

# Actor output Schema

## `results` (type: `string`):

Filtered Christchurch alcohol licence rows (LicenceeName removed, geometry omitted) written to the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "newOrExpiring",
    "days": 90,
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("spider355/nz-ccc-alcohol-licences").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "newOrExpiring",
    "days": 90,
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("spider355/nz-ccc-alcohol-licences").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "newOrExpiring",
  "days": 90,
  "maxItems": 200
}' |
apify call spider355/nz-ccc-alcohol-licences --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spider355/nz-ccc-alcohol-licences"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bw7bQUZ73mbJGqNf9/builds/ivSlbJW4AMdQg9wKS/openapi.json
