# NZ GETS Open Tenders Scraper (`spider355/nz-gets-open-tenders`) Actor

Filter open NZ government tenders from the official GETS RSS by keyword, region, and category. Structured RFx metadata only, not full documents. Not affiliated with or endorsed by MBIE or GETS. Public feed; contacts redacted. No income promises.

- **URL**: https://apify.com/spider355/nz-gets-open-tenders.md
- **Developed by:** [Mitchell](https://apify.com/spider355) (community)
- **Categories:** Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.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

## NZ GETS Open Tenders (Apify Actor)

Monitors **open tenders / RFQs** listed on New Zealand’s [Government Electronic Tender Service (GETS)](https://www.gets.govt.nz/) by fetching the **official RSS feed only**. Applies optional keyword, region, and category filters, then pushes structured records to the Actor dataset (pay-per-result ready).

**Data source:** GETS / NZ Government Electronic Tender Service official RSS (`ExternalRSSFeed.htm`). This Actor does **not** scrape tender detail HTML pages or `ExternalIndex.htm`.

### Output fields

Each dataset item:

| Field | Description |
|-------|-------------|
| `rfxId` | GETS RFx ID |
| `title` | Tender title |
| `organisation` | Issuing organisation (agency name) |
| `openDate` / `closeDate` | As published on the feed |
| `categories` | Category code + label strings |
| `region` | Region(s); multi-region joined with `; ` |
| `overview` | Short overview text from the feed |
| `url` | Link to the GETS tender details page |
| `publishedAt` | Feed `pubDate` / `dc:date` |

No personal contacts are invented or scraped. Organisation names from the public feed are included.

### Inputs

| Input | Type | Notes |
|-------|------|--------|
| `keywords` | string / array | Match **title or overview** (case-insensitive). Multiple = OR. |
| `regions` | string / array | Substring on **Region** (e.g. `Auckland`, `New Zealand`). Multiple = OR. |
| `categories` | string / array | Substring on category codes/labels (e.g. `81110000`, `Computer`). Multiple = OR. |
| `maxItems` | integer | Cap matched items (default **500**, max 5000). |

Filter types are **AND**ed; values within a type are **OR**ed.

#### Example input

```json
{
  "keywords": ["software", "cloud"],
  "regions": ["Auckland", "New Zealand"],
  "categories": ["81110000", "Computer"],
  "maxItems": 50
}
```

### Local development

Requirements: Node.js 18+.

```bash
cd /team/projects/01-apify-scrapers/src/nz-gets-open-tenders
npm install
npm test          # offline unit tests (fixture RSS)
npm run smoke     # optional live feed smoke (needs network)
```

Run the Actor locally with [Apify CLI](https://docs.apify.com/cli) (optional):

```bash
apify run -p
## or with input JSON:
## echo '{"keywords":["construction"],"maxItems":5}' > storage/key_value_stores/default/INPUT.json
## apify run
```

Without Apify CLI, `npm start` expects Apify runtime env (storage). Prefer `npm test` / `npm run smoke` for local checks.

#### Live smoke one-liner

```bash
node scripts/smoke.js --max 3
## optional allowlisted override: GETS_FEED_URL=https://www.gets.govt.nz/ExternalRSSFeed.htm node scripts/smoke.js --keyword computer --max 2
```

### Security notes

- **No Store `feedUrl` input** — the Actor always fetches the official GETS RSS URL (`www.gets.govt.nz` … `ExternalRSSFeed.htm`). Local/dev may set `GETS_FEED_URL` but it must pass the same allowlist (blocks SSRF).
- RSS response body is capped at **8 MiB** before parse.

### Deploy to Apify

1. Owner creates/logs into an Apify account (see `/team/OWNER_QUEUE.md`).
2. Install [Apify CLI](https://docs.apify.com/cli), then from this folder:

```bash
apify login
apify push
```

3. In Console: set Actor to **pay-per-result** (or pay-per-event), publish to Store when ready.
4. Monetization / Store listing is an **owner** step — no credentials are stored in this repo.

### Known limits

- **RSS only** — no full tender documents, attachments, or Q\&A threads.
- Feed volume is typically a few hundred open items; structure changes fail the run loudly (channel title / items / content-type checks).
- Region strings may list many regions separated by `; ` (from `<br>` in the feed).
- Overview text is from the feed with **purchaser emails and phone numbers redacted** (GETS republication condition). Other prose is kept.
- Be a polite client (User-Agent identifies this Actor; reasonable timeouts).

### Privacy

This Actor retrieves a **public** open-tender RSS feed. Filters are user-supplied. Results may include text already published on GETS. Purchaser emails and phone numbers are redacted from overview text. Processing runs on Apify. The creator does not sell user inputs for unrelated purposes.

### Attribution

Tender notices are Crown copyright material published on **GETS** and owned by the **Ministry of Business, Innovation and Employment (MBIE)**, reused with attribution under the GETS terms / NZGOAL framework referenced there. Source feed: [GETS open tenders RSS](https://www.gets.govt.nz/ExternalRSSFeed.htm).

This Actor is **not affiliated with or endorsed by MBIE or GETS**. Do not use GETS or government logos. For complete tender documents, register and respond on GETS itself — each result includes the live GETS `url` plus RFx ID, title, organisation (purchaser), and close date. Purchaser emails and phone numbers are removed from `overview`.

### Tech

- Node.js + official `apify` SDK
- `rss-parser` for RSS 2.0
- No Crawlee / no HTML page crawls

# Actor input Schema

## `keywords` (type: `string`):

Optional. Match title or overview (case-insensitive). Comma-separated string or JSON array. Multiple values = OR within this filter.

## `regions` (type: `string`):

Optional. Substring match on Region field (e.g. Auckland, New Zealand, Wellington). Comma-separated or JSON array. Multiple = OR.

## `categories` (type: `string`):

Optional. Substring match on category codes/labels (e.g. 81110000, Computer, Healthcare). Comma-separated or JSON array. Multiple = OR.

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

Optional cap on matched items pushed to the dataset. Default 500.

## Actor input object example

```json
{
  "maxItems": 500
}
```

# Actor output Schema

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

Open tender records 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("spider355/nz-gets-open-tenders").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("spider355/nz-gets-open-tenders").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 '{}' |
apify call spider355/nz-gets-open-tenders --silent --output-dataset

```

## MCP server setup

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

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/QsCvDf20xJ2eysqo3/builds/2S9sVylsF2Vs1YEYg/openapi.json
