# Nova Scotia Tender Awards API – Who Won What (`loudtzu/ns-tender-awards`) Actor

Nova Scotia awarded public tenders (~33,400 rows, Socrata dataset m6ps-8j6u, updated monthly): buyer, vendor, amount, awarded date, categories. Or vendor/buyer award-history summaries with totals. JSON/CSV, Open Government Licence – Nova Scotia. $0.005 per result.

- **URL**: https://apify.com/loudtzu/ns-tender-awards.md
- **Developed by:** [Travis M](https://apify.com/loudtzu) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% 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

## Nova Scotia Tender Awards API – Who Won What

**~33,400 awarded Nova Scotia public tenders** (who bought what, from whom, for how much, when) from the Province's Socrata API, updated monthly.

- **Per award:** tender ID, buyer, vendor, description, categories, tender dates, awarded date, awarded amount (CAD).
- **Summary modes:** per-vendor or per-buyer award count, total, average, first/last award, top counterparties.
- **Licence:** Open Government Licence – Nova Scotia; every row carries the attribution.
- **Output:** structured JSON, or CSV / Excel export from the Apify dataset.

**Why not build it yourself?** No Socrata paging or award aggregation to build. No scraper to write or maintain.

**Price:** $0.005 per result (half a cent; $5 per 1,000), no start fee.

### Awards history: who won what (`outputMode`)

- `records` (default): one row per award, as before.
- `vendorSummary`: one row per winning vendor. Shows award count, total and average CAD, first and last award date, how many buyers, the top buyers (`topN`, default 5, ranked by CAD, each with its last award date so you can spot incumbents and renewal timing), and award counts by category.
- `buyerSummary`: the same, one row per buyer, with its top vendors.

All filters (keyword, buyer, vendor, category, dates, amounts) apply first. Grouping runs server-side with Socrata `$select`/`$group` (vendor × buyer × category flags), and the Actor then merges those rows. Name spellings that differ only in case, spacing or trailing punctuation are merged, and every spelling found is listed in `nameVariants`. Different legal forms are not merged (for example "Dexter Construction" and "Dexter Construction Co. Ltd."). The average only counts awards that have an amount. In summary modes, `maxItems` caps the number of summary rows (largest total first). Every row carries `source` and `licence`.

### Vendor names and possible individuals

Vendor names are passed through exactly as the Province of Nova Scotia publishes them. The Actor does not correct, enrich or add contact details. Some vendors are sole proprietors trading under their own name. With `flagIndividuals` (on by default), each vendor row (records, vendorSummary rows, and each entry in buyerSummary `topVendors`) gets `vendorMayBeIndividual: true` when the name has no business word (Ltd, Inc, Corp, Limited, Co, LLP, Society, trade words like Construction or Services, etc.) and reads like a 2–4 word personal name. It's a heuristic: it misses some people and flags some firms (for example "Atlas Copco"). With `redactIndividuals` (off by default), flagged names are replaced with `[redacted: may be an individual]`.

**Icon:** `.actor/icon.png` (512x512, original, no provincial crest or logo).

### Run locally (no Apify account)

```
python3 -m venv .venv && .venv/bin/pip install apify httpx pytest
## input: storage/key_value_stores/default/INPUT.json
.venv/bin/python -m src        # results land in storage/datasets/default/
.venv/bin/python -m pytest tests
```

# Actor input Schema

## `outputMode` (type: `string`):

records = one row per award (default). vendorSummary = one row per winning vendor: award count, total and average CAD, first/last award date, top buyers, categories. buyerSummary = the same per buyer, with top vendors. All filters apply before grouping; grouping runs server-side on the Socrata API.

## `topN` (type: `integer`):

Summary modes only: how many top buyers (vendorSummary) or vendors (buyerSummary) to list, ranked by total CAD.

## `keyword` (type: `string`):

Full-text search across all text columns of the dataset (Socrata $q), e.g. description, buyer, vendor, tender ID (optional).

## `entity` (type: `string`):

Only buyers whose name contains this text, e.g. 'Dalhousie' (case-insensitive).

## `vendor` (type: `string`):

Only vendors whose name contains this text (case-insensitive).

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

Tender category.

## `awardedFrom` (type: `string`):

Optional start date, YYYY-MM-DD.

## `awardedTo` (type: `string`):

Optional end date, YYYY-MM-DD.

## `minAmount` (type: `integer`):

Optional.

## `maxAmount` (type: `integer`):

Optional.

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

Stop after this many rows. In summary modes this caps the number of vendor/buyer rows (largest total first); all matching awards are still counted.

## `flagIndividuals` (type: `boolean`):

Adds vendorMayBeIndividual (true/false) to vendor rows. True when the published vendor name has no business word (Ltd, Inc, Corp, Limited, Co, LLP, Society, Services, Construction, etc.), so it may be a sole proprietor trading under their own name. Heuristic only.

## `redactIndividuals` (type: `boolean`):

Replaces flagged vendor names with '\[redacted: may be an individual]'. In vendorSummary mode those vendors stay as separate rows but their names and name variants are removed.

## Actor input object example

```json
{
  "outputMode": "records",
  "topN": 5,
  "category": "any",
  "maxItems": 100,
  "flagIndividuals": true,
  "redactIndividuals": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("loudtzu/ns-tender-awards").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("loudtzu/ns-tender-awards").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 loudtzu/ns-tender-awards --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,loudtzu/ns-tender-awards"
        }
    }
}
```

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/Zv54gW3yBokQSFqHa/builds/nMjINe53V3h2LOdAK/openapi.json
