# Trademe Scraper — NZ Marketplace, Motors, Property & Jobs (`blackfalcondata/trademe-scraper`) Actor

Trademe scraper for New Zealand — pull used cars, property, rentals, jobs and goods with prices, photos, addresses, seller phone, email, make, model and bedrooms. Every listing arrives as structured fields with dealer and agent contacts.

- **URL**: https://apify.com/blackfalcondata/trademe-scraper.md
- **Developed by:** [Black Falcon Data](https://apify.com/blackfalcondata) (community)
- **Categories:** E-commerce, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### What does Trademe Scraper do?

Trademe Scraper pulls listings from every section of trademe.co.nz — Marketplace goods, Motors used cars, Property, Rentals, Jobs and Flatmates — in a single run. Each listing arrives as structured data rather than raw text: price, make, model, odometer, bedrooms, bathrooms, address, salary, photos, seller phone and email, typed per section. Filter by region, keyword and section, enrich with detail-page fields, and track only what changed between runs.

### How to use this actor

- 👉 **Register for a free Apify account** — no credit card required.
- 🎉 Just click **[Sign up free on Apify →](https://console.apify.com/sign-up?fpr=1h3gvi&fp_sid=ctarich)** and complete a quick signup.
- 💰 A free Apify account includes $5 in monthly credits — enough to test this actor.
- ⏳ Scrape during the free trial, with no commitment or upfront payment required.

### Key features

<!-- KEY_FEATURES:START -->
- **🧭 Six Trade Me sections, one actor** — Scrape Marketplace goods, Motors used cars, Property, Rentals, Jobs and Flatmates in one run — pick any combination. `maxResults` caps each section independently, so one never starves the others.
- **🚗 Typed vehicle specs + history** — every used-car listing carries `make`, `model`, `year`, `odometer`, `fuel`, `transmission`, `vin` and `numberPlate`, plus the dealership's name, phone, website and email. Seller-paid vehicle-history reports surface as `vehicleHistory` when present.
- **🏠 Property & rental detail** — `bedrooms`, `bathrooms`, `address`, latitude/longitude, `propertyType`, land/floor area, `rateableValue`, agent contacts, open-home times and broadband availability. Rentals add `rentPerWeek`, `availableFrom` and `maxTenants`.
- **💼 Structured jobs & salary** — job listings carry the full ad, `employmentType`, `payType`, the employer's `benefits`, and a parsed `salaryMin` / `salaryMax` / `salaryPeriod` where published. Emails are extracted into `extractedEmails`.
- **💵 Price, typed** — `priceText` plus a parsed `priceValue` in NZD, the `buyNowPrice`, and the pre-discount `wasPrice` when a seller marks down. Property asking prices are recovered even when the API reports them as zero.
- **📋 Detail enrichment** — two-stage scraping — list first, then enrich each listing with the full detail-page payload. One input toggle controls the depth.
- **♻️ Incremental mode** — daily runs emit only listings that are new or whose price/condition changed since last run. Perfect for inventory-diff dashboards and competitive pricing alerts. Saves 80–95% on recurring monitoring.
- **🔔 Notifications** — telegram / Slack / Discord / WhatsApp / webhook alerts on each run. Combine with incremental to ping only when prices or inventory actually move.
- **🔌 MCP connectors** — export results into Notion via Apify's MCP connectors — a clean run-summary page, no glue code. Opt-in via the App connector field; deterministic field-mapping, no AI.
<!-- KEY_FEATURES:END -->

### What data can you extract from trademe.co.nz?

Each result includes Core listing fields (`listingId`, `listingKey`, `vertical`, `title`, `subtitle`, `category`, `categoryPath`, and `region`, and more), detail fields when enrichment is enabled (`description`, `descriptionText`, `descriptionHtml`, `descriptionMarkdown`, and `modelDetail`), contact and apply information (`sellerPhone`, `contactEmail`, `extractedEmails`, and `applyViaTradeMe`), and company metadata (`company`). In standard mode, all fields are always present — unavailable data points are returned as `null`, never omitted. In compact mode, only core fields are returned.

Enable detail enrichment in the input to get richer fields such as full descriptions, company metadata, and contact information where the source provides them.

### Input

The main inputs are a search keyword, an optional location filter, and a result limit. Additional filters and options are available in the input schema.

Key parameters:

- **`query`** — Listing search keywords. Required if no startUrls provided.
- **`vertical`** — Which Trade Me sections to scrape — Marketplace (general goods), Motors (used cars), Property & Rentals (homes for sale/rent), Jobs, Flatmates. (default: `["marketplace"]`)
- **`region`** — Limit results to one or more New Zealand regions. Leave empty to search the whole country. Timaru - Oamaru applies to Marketplace and Motors only. (default: `[]`)
- **`category`** — Optional Trade Me category code to narrow results, e.g. 0002-0356- for Computers. Leave empty to include all categories in the selected section.
- **`startUrls`** — Paste raw search URLs from trademe.co.nz — category or search-result pages. Each URL becomes its own task; results merge and dedupe by listing ID. When provided, startUrls replace the query/vertical/region fields. (default: `[]`)
- **`country`** — Which market to search. (default: `"NZ"`)
- **`maxResults`** — Maximum listings to return per selected section — each section is capped independently when several are chosen. Set 0 for no limit. (default: `25`)
- **`includeDetails`** — Fetch full listing details. (default: `true`)
- **`descriptionMaxLength`** — Truncate description to N chars. 0 = no truncation. (default: `0`)
- **`compact`** — Core fields only (for AI-agent/MCP workflows). (default: `false`)
- **`incrementalMode`** — Only return listings that are new or changed since your last run. Different search settings are tracked separately — leave stateKey empty unless you want two searches to share one history. (default: `false`)
- **`stateKey`** — Optional. Stable identifier for the tracked search universe. Leave empty to auto-generate from search inputs.
- ...and 18 more parameters

### Input examples

**Basic search** — Keyword-driven search with a result cap.

→ Full payload per result — all standard fields populated where the source provides them.

```json
{
  "query": "used bicycle",
  "maxResults": 50
}
````

**Incremental tracking** — Only emit listings that changed since the previous run with this `stateKey`.

→ First run builds the baseline state. Subsequent runs emit only records that are new or whose tracked content changed. Set `emitUnchanged: true` to include unchanged records as well.

```json
{
  "query": "used bicycle",
  "maxResults": 200,
  "incrementalMode": true,
  "stateKey": "used-bicycle-tracker"
}
```

**Compact output for AI agents** — Return only core fields for AI-agent and MCP workflows.

→ Small payload with the most important fields — ideal for piping into LLMs without token overhead.

```json
{
  "query": "used bicycle",
  "maxResults": 50,
  "compact": true
}
```

### Output

Each run produces a dataset of structured listing records. Results can be downloaded as JSON, CSV, or Excel from the Dataset tab in Apify Console.

### Example listing record

```json
{
  "listingId": "42341223c436627afcc8d1ae5641c5dd18d8699a5cb02362662424cff73a2f74",
  "listingKey": "6038890908",
  "vertical": "motors",
  "title": "2017 Holden Captiva Ls Equipe",
  "subtitle": "Low Kilometre Holden Captiva - Excellent Condition",
  "category": "Holden",
  "categoryPath": "/Trade-Me-Motors/Cars/Holden",
  "region": "Auckland",
  "suburb": "Manukau",
  "priceText": "$12,000",
  "priceValue": 12000,
  "buyNowPrice": 14000,
  "priceCurrency": "NZD",
  "listingType": "auction",
  "reserveState": "met",
  "url": "https://www.trademe.co.nz/a/listing/6038890908",
  "portalUrl": "https://www.trademe.co.nz/a/listing/6038890908",
  "imageUrl": "https://trademe.tmcdn.co.nz/photoserver/med/2318363175.jpg",
  "galleryUrls": [
    "https://trademe.tmcdn.co.nz/photoserver/med/2318363175.jpg",
    "https://trademe.tmcdn.co.nz/photoserver/med/2318363177.jpg",
    "https://trademe.tmcdn.co.nz/photoserver/med/2318363178.jpg",
    "https://trademe.tmcdn.co.nz/photoserver/med/2318363179.jpg",
    "https://trademe.tmcdn.co.nz/photoserver/med/2318363180.jpg"
  ],
  "publishedAt": "2026-07-17T13:00:12.767Z",
  "endsAt": "2026-08-31T09:30:00.000Z",
  "asAt": "2026-07-17T13:56:59.357Z",
  "description": "Well-maintained Holden Captiva with exceptionally low kilometres (under 50,000km).\n\nWe are the first and only NZ owners and are selling simply because the vehicle is now surplus to our requirements....",
  "descriptionText": "Well-maintained Holden Captiva with exceptionally low kilometres (under 50,000km).\n\nWe are the first and only NZ owners and are selling simply because the vehicle is now surplus to our requirements....",
  "descriptionHtml": "Well-maintained Holden Captiva with exceptionally low kilometres (under 50,000km).\n\nWe are the first and only NZ owners and are selling simply because the vehicle is now surplus to our requirements....",
  "sellerName": "gosa7",
  "sellerType": "member",
  "memberId": 3198576,
  "make": "Holden",
  "model": "Captiva",
  "modelDetail": "Ls Equipe",
  "year": 2017,
  "odometer": 50000,
  "fuel": "Petrol",
  "transmission": "Automatic",
  "bodyStyle": "RV/SUV",
  "engineSize": 2384,
  "doors": 4,
  "seats": 7,
  "exteriorColour": "Black",
  "vin": "KL3CA26U9HB750845",
  "numberPlate": "KMG917",
  "is4WD": false,
  "importHistory": "1",
  "isDealer": false,
  "onRoadCostsIncluded": true,
  "vehicleHistory": {
    "reportedStolen": "NO",
    "moneyOwing": "NO",
    "damaged": "N/A",
    "reRegistered": "NO",
    "regoOrVin": "KMG917",
    "reportUrl": "https://www.trademe.co.nz/link.aspx?i=73847&plate=KMG917",
    "generatedAt": "2026-07-17T13:00:18.000Z"
  },
  "hasBuyNow": true,
  "viewCount": 63,
  "attributes": [
    "On road costs: Included",
    "Number plate: KMG917",
    "Year: 2017",
    "Kilometres: 50,000km",
    "Exterior colour: Black",
    "... 13 more items"
  ],
  "contentQuality": "full",
  "detailFetched": true,
  "contentHash": "f8043c87f2a8ab3428bb7b640ab3db130dda851415d91bce70b34f2ecd168773",
  "scrapedAt": "2026-07-17T13:56:59.030Z",
  "source": "trademe.co.nz"
}
```

### Incremental fields

When incremental mode is on, each record also carries:

- `changeType` — one of `NEW`, `UPDATED`, `UNCHANGED`, `REAPPEARED`, `EXPIRED`. Default output covers `NEW` / `UPDATED` / `REAPPEARED`; set `emitUnchanged: true` or `emitExpired: true` to opt into the others.
- `isRepost`, `repostOfId`, `repostDetectedAt` — populated when a new listing matches the tracked content of a previously expired one. Set `skipReposts: true` to drop detected reposts from the output.

### How to scrape trademe.co.nz

1. Go to [Trademe Scraper](https://apify.com/blackfalcondata/trademe-scraper?fpr=1h3gvi) in Apify Console.
2. Enter a search keyword and optional location filter.
3. Set `maxResults` to control how many results you need.
4. Enable `includeDetails` if you need full descriptions, contact info, company data.
5. Click **Start** and wait for the run to finish.
6. Export the dataset as JSON, CSV, or Excel.

### Use cases

- Extract listing data from trademe.co.nz for market research and competitive analysis.
- Track pricing trends across regions and categories over time.
- Monitor new and changed listings on scheduled runs without processing the full dataset every time.
- Build outreach lists using contact details and apply URLs from listings.
- Research broker and agency profiles, provider coverage, and market distribution.
- Use structured location data for regional analysis, mapping, and geo-targeting.
- Feed structured data into AI agents, MCP tools, and automated pipelines using compact mode.
- Export clean, structured data to dashboards, spreadsheets, or data warehouses.

### How much does it cost to scrape trademe.co.nz?

Trademe Scraper uses [pay-per-event](https://docs.apify.com/platform/actors/paid-actors/pay-per-event) pricing. You pay a small fee when the run starts and then for each result that is actually produced.

- **Run start:** $0.005 per run
- **Per result:** $0.0015 per listing record

Example costs:

- 10 results: **$0.02**
- 25 results: **$0.042**
- 100 results: **$0.15**
- 200 results: **$0.3**
- 500 results: **$0.76**

#### Example: recurring monitoring savings

These examples compare full re-scrapes with incremental runs at different churn rates. Churn is the share of listings that are new or whose tracked content changed since the previous run. Actual churn depends on your query breadth, source activity, and polling frequency — the scenarios below are examples, not predictions.

Example setup: 100 results per run, daily polling (30 runs/month). Event-pricing examples scale linearly with result count.

| Churn rate | Full re-scrape run cost | Incremental run cost | Savings vs full re-scrape | Monthly cost after baseline |
|---|---:|---:|---:|---:|
| 5% — stable niche query | $0.15 | $0.01 | $0.14 (92%) | $0.38 |
| 15% — moderate broad query | $0.15 | $0.03 | $0.13 (82%) | $0.82 |
| 30% — high-volume aggregator | $0.15 | $0.05 | $0.11 (68%) | $1.50 |

Full re-scrape monthly cost at daily polling: $4.65. First month with incremental costs $0.52 / $0.95 / $1.60 for the 5% / 15% / 30% scenarios because the first run builds baseline state at full cost before incremental savings apply.

Platform usage is included in the per-result fee shown above.

### FAQ

#### How many results can I get from trademe.co.nz?

The number of results depends on the search query and available listings on trademe.co.nz. Use the `maxResults` parameter to control how many results are returned per run.

#### Does Trademe Scraper support recurring monitoring?

Yes. Enable incremental mode to only receive new or changed listings on subsequent runs. This is ideal for scheduled monitoring where you want to track changes over time without re-processing the full dataset.

#### Can I integrate Trademe Scraper with other apps?

Yes. Trademe Scraper works with Apify's [integrations](https://apify.com/integrations?fpr=1h3gvi) to connect with tools like Zapier, Make, Google Sheets, Slack, and more. You can also use webhooks to trigger actions when a run completes.

#### Can I use Trademe Scraper with the Apify API?

Yes. You can start runs, manage inputs, and retrieve results programmatically through the [Apify API](https://docs.apify.com/api/v2). Client libraries are available for JavaScript, Python, and other languages.

#### Can I use Trademe Scraper through an MCP Server?

Yes. Apify provides an [MCP Server](https://apify.com/apify/actors-mcp-server?fpr=1h3gvi) that lets AI assistants and agents call this actor directly. Use compact mode, `descriptionMaxLength`, a single `descriptionFormat`, and `excludeEmptyFields` to keep payloads manageable for LLM context windows.

#### Is it legal to scrape trademe.co.nz?

This actor extracts publicly available data from trademe.co.nz. Web scraping of public information is generally considered legal, but you should always review the target site's terms of service and ensure your use case complies with applicable laws and regulations, including GDPR where relevant.

#### Your feedback

If you have questions, need a feature, or found a bug, please [open an issue](https://apify.com/blackfalcondata/trademe-scraper/issues?fpr=1h3gvi) on the actor's page in Apify Console. Your feedback helps us improve.

### You might also like

- [Airbnb Realtime API — Live Listing, Reviews & Search Lookups](https://apify.com/blackfalcondata/airbnb-realtime?fpr=1h3gvi) — Real-time Airbnb lookups via a persistent standby server — fetch a single listing, its reviews.
- [Airbnb Scraper — Listings, Prices, Reviews & Host Data](https://apify.com/blackfalcondata/airbnb-scraper?fpr=1h3gvi) — Scrape Airbnb stays — listings with price, ratings, amenities, host info, photos, GPS and full.
- [Airbnb URL Scraper — Fast, Cheap Listing URL Discovery](https://apify.com/blackfalcondata/airbnb-url-scraper?fpr=1h3gvi) — Discover every Airbnb listing URL for a city, neighborhood or search — the cheapest way to.
- [Craigslist Scraper - Listings, Prices & Photos](https://apify.com/blackfalcondata/craigslist-scraper?fpr=1h3gvi) — Scrape craigslist.org listings across for-sale, housing, jobs, gigs and services. Get structured.
- [Domain.com.au Property Scraper — Listings, Prices & Agents](https://apify.com/blackfalcondata/domain-com-au-scraper?fpr=1h3gvi) — Domain.com.au property scraper for Australian real estate — extract listings for sale, rent.
- [HAR Texas Real Estate Scraper](https://apify.com/blackfalcondata/har-scraper?fpr=1h3gvi) — Scrape har.com — the largest Texas MLS portal — for homes for sale, rent and sold in every Texas.
- [Harcourts Property Scraper — buy, rent, sold & leased](https://apify.com/blackfalcondata/harcourts-scraper?fpr=1h3gvi) — Scrape harcourts.net property listings across Australia, New Zealand and Fiji — price, bedrooms,.
- [Idealista Scraper — Listings, Phone & Agency Data](https://apify.com/blackfalcondata/idealista-scraper?fpr=1h3gvi) — Scrape Idealista listings across Spain, Portugal, and Italy with full pricing, photos, GPS, agent.

### Getting started with Apify

New to Apify? [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=1h3gvi\&fp_sid=ctarich) — no credit card required.

1. Sign up — $5 platform credit included
2. Open this actor and configure your input
3. Click **Start** — export results as JSON, CSV, or Excel

Need more later? [See Apify pricing](https://apify.com/pricing?fpr=1h3gvi).

# Actor input Schema

## `query` (type: `string`):

Listing search keywords. Required if no startUrls provided.

## `vertical` (type: `array`):

Which Trade Me sections to scrape — Marketplace (general goods), Motors (used cars), Property & Rentals (homes for sale/rent), Jobs, Flatmates.

## `region` (type: `array`):

Limit results to one or more New Zealand regions. Leave empty to search the whole country. Timaru - Oamaru applies to Marketplace and Motors only.

## `category` (type: `string`):

Optional Trade Me category code to narrow results, e.g. 0002-0356- for Computers. Leave empty to include all categories in the selected section.

## `startUrls` (type: `array`):

Paste raw search URLs from trademe.co.nz — category or search-result pages. Each URL becomes its own task; results merge and dedupe by listing ID. When provided, startUrls replace the query/vertical/region fields.

## `country` (type: `string`):

Which market to search.

## `maxResults` (type: `integer`):

Maximum listings to return per selected section — each section is capped independently when several are chosen. Set 0 for no limit.

## `includeDetails` (type: `boolean`):

Fetch full listing details.

## `descriptionMaxLength` (type: `integer`):

Truncate description to N chars. 0 = no truncation.

## `compact` (type: `boolean`):

Core fields only (for AI-agent/MCP workflows).

## `incrementalMode` (type: `boolean`):

Only return listings that are new or changed since your last run. Different search settings are tracked separately — leave stateKey empty unless you want two searches to share one history.

## `stateKey` (type: `string`):

Optional. Stable identifier for the tracked search universe. Leave empty to auto-generate from search inputs.

## `emitUnchanged` (type: `boolean`):

When comparing against your last run, also return listings that have not changed. Off by default so each run returns only what is new or updated.

## `emitExpired` (type: `boolean`):

Also return listings that have disappeared since your last run, marked as expired. Useful for tracking when items sell or ads are pulled.

## `skipReposts` (type: `boolean`):

When incremental, skip listings whose content matches an expired listing from a prior run (cross-run duplicate detection).

## `telegramToken` (type: `string`):

Telegram bot token (from @BotFather). Required for Telegram notifications.

## `telegramChatId` (type: `string`):

Telegram chat or channel ID (e.g. "-100123456789"). Required when telegramToken is set.

## `discordWebhookUrl` (type: `string`):

Discord incoming webhook URL. Server Settings → Integrations → Webhooks → New Webhook.

## `slackWebhookUrl` (type: `string`):

Slack incoming webhook URL. api.slack.com/messaging/webhooks.

## `notificationLimit` (type: `integer`):

Maximum number of listings included in each notification message (1–20).

## `notifyOnlyChanges` (type: `boolean`):

When Incremental Mode is on, only send notifications for NEW and UPDATED listings. Has no effect outside incremental mode.

## `whatsappAccessToken` (type: `string`):

WhatsApp Cloud API permanent access token (System User token from Meta Business). Recipient must have messaged the business number within the last 24h (service-conversation window — free since Nov 2024).

## `whatsappPhoneNumberId` (type: `string`):

Your WhatsApp Business phone-number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set.

## `whatsappTo` (type: `string`):

Recipient phone in E.164 format without + (e.g. "436641234567"). Recipient must have messaged your business number within last 24h.

## `webhookUrl` (type: `string`):

Receives a JSON POST with {metadata, items} after each run. Universal escape hatch for n8n / Make / Zapier / custom backends.

## `webhookHeaders` (type: `object`):

Optional JSON object of custom headers (e.g. {"Authorization":"Bearer ..."}).

## `descriptionFormat` (type: `string`):

Pick a single description representation. `all` keeps every variant; `text` / `html` / `markdown` drop the others.

## `excludeEmptyFields` (type: `boolean`):

Drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards.

## `appConnector` (type: `string`):

Optional. Pick a connected app under Settings → API & Integrations to receive your results (including any contact details). Best-effort across MCP connectors as Apify expands its catalog.

## `mcpIssueTeam` (type: `string`):

Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one.

## Actor input object example

```json
{
  "query": "used bicycle",
  "vertical": [
    "marketplace"
  ],
  "region": [],
  "category": "0002-0356-",
  "startUrls": [],
  "country": "NZ",
  "maxResults": 5,
  "includeDetails": true,
  "descriptionMaxLength": 0,
  "compact": false,
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false,
  "skipReposts": false,
  "notificationLimit": 5,
  "notifyOnlyChanges": false,
  "descriptionFormat": "all",
  "excludeEmptyFields": false
}
```

# Actor output Schema

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

No description

# 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 = {
    "query": "used bicycle",
    "vertical": [
        "marketplace"
    ],
    "maxResults": 5,
    "descriptionFormat": "all",
    "excludeEmptyFields": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("blackfalcondata/trademe-scraper").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 = {
    "query": "used bicycle",
    "vertical": ["marketplace"],
    "maxResults": 5,
    "descriptionFormat": "all",
    "excludeEmptyFields": False,
}

# Run the Actor and wait for it to finish
run = client.actor("blackfalcondata/trademe-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": "used bicycle",
  "vertical": [
    "marketplace"
  ],
  "maxResults": 5,
  "descriptionFormat": "all",
  "excludeEmptyFields": false
}' |
apify call blackfalcondata/trademe-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=blackfalcondata/trademe-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Trademe Scraper — NZ Marketplace, Motors, Property & Jobs",
        "description": "Trademe scraper for New Zealand — pull used cars, property, rentals, jobs and goods with prices, photos, addresses, seller phone, email, make, model and bedrooms. Every listing arrives as structured fields with dealer and agent contacts.",
        "version": "0.1",
        "x-build-id": "qFqJY2W1mgXW24dbU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/blackfalcondata~trademe-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-blackfalcondata-trademe-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/blackfalcondata~trademe-scraper/runs": {
            "post": {
                "operationId": "runs-sync-blackfalcondata-trademe-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/blackfalcondata~trademe-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-blackfalcondata-trademe-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "🔍 Search Term(s)",
                        "type": "string",
                        "description": "Listing search keywords. Required if no startUrls provided."
                    },
                    "vertical": {
                        "title": "Section",
                        "type": "array",
                        "description": "Which Trade Me sections to scrape — Marketplace (general goods), Motors (used cars), Property & Rentals (homes for sale/rent), Jobs, Flatmates.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "marketplace",
                                "motors",
                                "property",
                                "rental",
                                "jobs",
                                "flatmates"
                            ],
                            "enumTitles": [
                                "Marketplace (general goods)",
                                "Motors (used cars)",
                                "Property (for sale)",
                                "Rentals (to rent)",
                                "Jobs",
                                "Flatmates"
                            ]
                        },
                        "default": [
                            "marketplace"
                        ]
                    },
                    "region": {
                        "title": "🌍 Region",
                        "type": "array",
                        "description": "Limit results to one or more New Zealand regions. Leave empty to search the whole country. Timaru - Oamaru applies to Marketplace and Motors only.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "Northland",
                                "Auckland",
                                "Waikato",
                                "Bay of Plenty",
                                "Gisborne",
                                "Hawke's Bay",
                                "Taranaki",
                                "Manawatu / Whanganui",
                                "Whanganui",
                                "Wairarapa",
                                "Wellington",
                                "Nelson / Tasman",
                                "Marlborough",
                                "West Coast",
                                "Canterbury",
                                "Timaru - Oamaru",
                                "Otago",
                                "Southland"
                            ]
                        },
                        "default": []
                    },
                    "category": {
                        "title": "📁 Category code",
                        "type": "string",
                        "description": "Optional Trade Me category code to narrow results, e.g. 0002-0356- for Computers. Leave empty to include all categories in the selected section."
                    },
                    "startUrls": {
                        "title": "🔗 Start URLs",
                        "type": "array",
                        "description": "Paste raw search URLs from trademe.co.nz — category or search-result pages. Each URL becomes its own task; results merge and dedupe by listing ID. When provided, startUrls replace the query/vertical/region fields.",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "country": {
                        "title": "🌍 Country",
                        "enum": [
                            "NZ"
                        ],
                        "type": "string",
                        "description": "Which market to search.",
                        "default": "NZ"
                    },
                    "maxResults": {
                        "title": "💯 Max Results",
                        "minimum": 0,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum listings to return per selected section — each section is capped independently when several are chosen. Set 0 for no limit.",
                        "default": 25
                    },
                    "includeDetails": {
                        "title": "📋 Include Full Details",
                        "type": "boolean",
                        "description": "Fetch full listing details.",
                        "default": true
                    },
                    "descriptionMaxLength": {
                        "title": "✂️ Description Max Length",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Truncate description to N chars. 0 = no truncation.",
                        "default": 0
                    },
                    "compact": {
                        "title": "📦 Compact Output",
                        "type": "boolean",
                        "description": "Core fields only (for AI-agent/MCP workflows).",
                        "default": false
                    },
                    "incrementalMode": {
                        "title": "♻️ Incremental Mode",
                        "type": "boolean",
                        "description": "Only return listings that are new or changed since your last run. Different search settings are tracked separately — leave stateKey empty unless you want two searches to share one history.",
                        "default": false
                    },
                    "stateKey": {
                        "title": "🔑 State Key",
                        "type": "string",
                        "description": "Optional. Stable identifier for the tracked search universe. Leave empty to auto-generate from search inputs."
                    },
                    "emitUnchanged": {
                        "title": "♻️ Include unchanged listings",
                        "type": "boolean",
                        "description": "When comparing against your last run, also return listings that have not changed. Off by default so each run returns only what is new or updated.",
                        "default": false
                    },
                    "emitExpired": {
                        "title": "⚰️ Include ended listings",
                        "type": "boolean",
                        "description": "Also return listings that have disappeared since your last run, marked as expired. Useful for tracking when items sell or ads are pulled.",
                        "default": false
                    },
                    "skipReposts": {
                        "title": "🚫 Skip Reposts",
                        "type": "boolean",
                        "description": "When incremental, skip listings whose content matches an expired listing from a prior run (cross-run duplicate detection).",
                        "default": false
                    },
                    "telegramToken": {
                        "title": "🔑 Telegram Bot Token",
                        "type": "string",
                        "description": "Telegram bot token (from @BotFather). Required for Telegram notifications."
                    },
                    "telegramChatId": {
                        "title": "💬 Telegram Chat ID",
                        "type": "string",
                        "description": "Telegram chat or channel ID (e.g. \"-100123456789\"). Required when telegramToken is set."
                    },
                    "discordWebhookUrl": {
                        "title": "🎮 Discord Webhook URL",
                        "type": "string",
                        "description": "Discord incoming webhook URL. Server Settings → Integrations → Webhooks → New Webhook."
                    },
                    "slackWebhookUrl": {
                        "title": "💼 Slack Webhook URL",
                        "type": "string",
                        "description": "Slack incoming webhook URL. api.slack.com/messaging/webhooks."
                    },
                    "notificationLimit": {
                        "title": "📊 Max Listings Per Notification",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of listings included in each notification message (1–20).",
                        "default": 5
                    },
                    "notifyOnlyChanges": {
                        "title": "🔄 Notify Only New/Updated",
                        "type": "boolean",
                        "description": "When Incremental Mode is on, only send notifications for NEW and UPDATED listings. Has no effect outside incremental mode.",
                        "default": false
                    },
                    "whatsappAccessToken": {
                        "title": "📱 WhatsApp Access Token",
                        "type": "string",
                        "description": "WhatsApp Cloud API permanent access token (System User token from Meta Business). Recipient must have messaged the business number within the last 24h (service-conversation window — free since Nov 2024)."
                    },
                    "whatsappPhoneNumberId": {
                        "title": "📞 WhatsApp Phone Number ID",
                        "type": "string",
                        "description": "Your WhatsApp Business phone-number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set."
                    },
                    "whatsappTo": {
                        "title": "📲 WhatsApp Recipient",
                        "type": "string",
                        "description": "Recipient phone in E.164 format without + (e.g. \"436641234567\"). Recipient must have messaged your business number within last 24h."
                    },
                    "webhookUrl": {
                        "title": "🪝 Generic Webhook URL",
                        "type": "string",
                        "description": "Receives a JSON POST with {metadata, items} after each run. Universal escape hatch for n8n / Make / Zapier / custom backends."
                    },
                    "webhookHeaders": {
                        "title": "📋 Webhook Headers",
                        "type": "object",
                        "description": "Optional JSON object of custom headers (e.g. {\"Authorization\":\"Bearer ...\"})."
                    },
                    "descriptionFormat": {
                        "title": "Description format",
                        "enum": [
                            "all",
                            "text",
                            "html",
                            "markdown"
                        ],
                        "type": "string",
                        "description": "Pick a single description representation. `all` keeps every variant; `text` / `html` / `markdown` drop the others.",
                        "default": "all"
                    },
                    "excludeEmptyFields": {
                        "title": "Exclude empty fields from output",
                        "type": "boolean",
                        "description": "Drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards.",
                        "default": false
                    },
                    "appConnector": {
                        "title": "Send results to a connected app",
                        "type": "string",
                        "description": "Optional. Pick a connected app under Settings → API & Integrations to receive your results (including any contact details). Best-effort across MCP connectors as Apify expands its catalog."
                    },
                    "mcpIssueTeam": {
                        "title": "Issue tracker team",
                        "type": "string",
                        "description": "Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
