# Subcontractor Insurance Certificate Expiry Tracker & Alerts (`armourylabs/subcontractor-certificate-expiry-checker`) Actor

Tracks subcontractor insurance certificate expiry dates across your panel. Flags each certificate VALID, EXPIRING\_SOON, EXPIRED or UNKNOWN with days remaining, plus a prioritised alert list. Date tracking only — does not verify coverage or authenticity. One dataset item per certificate.

- **URL**: https://apify.com/armourylabs/subcontractor-certificate-expiry-checker.md
- **Developed by:** [Christopher Smith](https://apify.com/armourylabs) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $85.00 / 1,000 certificate checkeds

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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Subcontractor Insurance Certificate Expiry Tracker & Alerts

Track subcontractor insurance certificate expiry dates across your whole panel in one run. Feed in your certificate register — Public Liability, Workers Compensation, Professional Indemnity and more — and get back a status per certificate, days until expiry, and a prioritised alert list with expired cover first.

Built for construction insurance brokers, head contractors, WHS managers and procurement teams who currently track expiries in spreadsheets and find out about lapsed cover after the uninsured work has already happened.

### What does the Certificate Expiry Tracker do?

- **Flags every certificate** as `VALID`, `EXPIRING_SOON`, `EXPIRED`, or `UNKNOWN` (unparseable/missing date)
- **Calculates days until expiry** — negative numbers mean the cover has already lapsed
- **Builds a prioritised alert list** — expired certificates first, then soonest-to-expire
- **Summarises panel health** — counts per status at a glance
- **Parses the date formats certificates actually use**: `YYYY-MM-DD`, `DD/MM/YYYY`, `DD-MM-YYYY`, `MM/DD/YYYY`, `12 Mar 2026`, `12 March 2026`
- **Configurable alert window** (default 60 days — typical renewal lead time)
- **What-if analysis** — set a `reference_date` to see next month's panel today

### How do I track certificate expiries with it?

1. Paste your certificate records into the input (JSON — export from your register or spreadsheet).
2. Optionally set `alert_days` (how far ahead to warn) and `reference_date`.
3. Run. Each certificate comes back as one dataset row; the summary and alert list land in the run's `SUMMARY` key-value record.

### Input example

```json
{
  "certificates": [
    {"subcontractor": "Smith Electrical", "certificate_type": "PL",
     "expiry_date": "2026-08-01", "insurer": "CGU", "policy_number": "CGU-001"},
    {"subcontractor": "Jones Plumbing", "certificate_type": "WC",
     "expiry_date": "15/06/2026"}
  ],
  "alert_days": 60
}
````

### Output example (one dataset row per certificate)

```json
{
  "subcontractor": "Smith Electrical",
  "certificate_type": "PL",
  "insurer": "CGU",
  "policy_number": "CGU-001",
  "expiry_date": "2026-08-01",
  "days_until_expiry": 18,
  "status": "EXPIRING_SOON"
}
```

### Pricing (pay-per-event)

| Event | Price |
|---|---|
| Actor start | USD $0.10 per run |
| Certificate checked | USD $0.085 per certificate (one dataset row each) |

You pay only for what you check. A typical broker panel of ~50 certificates, checked weekly, works out to roughly **USD $19/month** (≈217 certificates + ~4 runs). No subscription, no unused-seat waste.

### FAQ

**Does it verify that the insurance cover is genuine or adequate?**
No. It tracks **expiry dates only**. `VALID` means "the expiry date is in the future" — it does not verify the certificate's authenticity, the insurer, or the adequacy of cover. Those checks stay with your broker or compliance team.

**Does it read certificate PDFs?**
No — it takes structured records (the data you or your systems have already extracted). That keeps it fast, cheap, and fully offline: your data is processed in-run and never sent to any third-party service.

**Is this an AI tool?**
No. It is deterministic date arithmetic — same input, same output, every time. That is a feature: expiry compliance should not depend on a model's mood.

**What happens with a missing or unreadable expiry date?**
The certificate is flagged `UNKNOWN` and included in the summary so it can't silently fall through the cracks.

### Support & feedback

Found an issue or need a feature (CSV export and scheduled reporting are on the roadmap — they will only be advertised once they exist)? Open an issue on this Actor's **Issues** tab and it will be looked at promptly.

# Actor input Schema

## `certificates` (type: `array`):

List of subcontractor insurance certificate records to check. Each record should include at minimum 'subcontractor' and 'expiry\_date'.

## `reference_date` (type: `string`):

The date to use as 'today' for expiry calculations. ISO format YYYY-MM-DD. Defaults to the actual current date. Useful for scheduled reports or historical analysis.

## `alert_days` (type: `integer`):

Certificates expiring within this many days are flagged as EXPIRING\_SOON. Default is 60 days, which covers typical insurance renewal lead times.

## Actor input object example

```json
{
  "certificates": [],
  "reference_date": "2025-06-01",
  "alert_days": 60
}
```

# 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("armourylabs/subcontractor-certificate-expiry-checker").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("armourylabs/subcontractor-certificate-expiry-checker").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 '{}' |
apify call armourylabs/subcontractor-certificate-expiry-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=armourylabs/subcontractor-certificate-expiry-checker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Subcontractor Insurance Certificate Expiry Tracker & Alerts",
        "description": "Tracks subcontractor insurance certificate expiry dates across your panel. Flags each certificate VALID, EXPIRING_SOON, EXPIRED or UNKNOWN with days remaining, plus a prioritised alert list. Date tracking only — does not verify coverage or authenticity. One dataset item per certificate.",
        "version": "0.1",
        "x-build-id": "w1ZdOfl6lKR12ym72"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/armourylabs~subcontractor-certificate-expiry-checker/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-armourylabs-subcontractor-certificate-expiry-checker",
                "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/armourylabs~subcontractor-certificate-expiry-checker/runs": {
            "post": {
                "operationId": "runs-sync-armourylabs-subcontractor-certificate-expiry-checker",
                "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/armourylabs~subcontractor-certificate-expiry-checker/run-sync": {
            "post": {
                "operationId": "run-sync-armourylabs-subcontractor-certificate-expiry-checker",
                "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",
                "required": [
                    "certificates"
                ],
                "properties": {
                    "certificates": {
                        "title": "Certificate Records",
                        "type": "array",
                        "description": "List of subcontractor insurance certificate records to check. Each record should include at minimum 'subcontractor' and 'expiry_date'.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "subcontractor": {
                                    "title": "Subcontractor Name",
                                    "description": "Legal name or trading name of the subcontractor.",
                                    "type": "string"
                                },
                                "certificate_type": {
                                    "title": "Certificate Type",
                                    "description": "Type of insurance — e.g. PL (Public Liability), WC (Workers Compensation), PI (Professional Indemnity).",
                                    "type": "string"
                                },
                                "expiry_date": {
                                    "title": "Expiry Date",
                                    "description": "Certificate expiry date. Accepts YYYY-MM-DD, DD/MM/YYYY, DD-MM-YYYY, DD Mon YYYY, and other common formats.",
                                    "type": "string"
                                },
                                "insurer": {
                                    "title": "Insurer",
                                    "description": "Name of the insuring company (optional).",
                                    "type": "string"
                                },
                                "policy_number": {
                                    "title": "Policy Number",
                                    "description": "Policy or certificate reference number (optional).",
                                    "type": "string"
                                },
                                "notes": {
                                    "title": "Notes",
                                    "description": "Any additional notes about this certificate (optional).",
                                    "type": "string"
                                }
                            }
                        },
                        "default": []
                    },
                    "reference_date": {
                        "title": "Reference Date",
                        "type": "string",
                        "description": "The date to use as 'today' for expiry calculations. ISO format YYYY-MM-DD. Defaults to the actual current date. Useful for scheduled reports or historical analysis."
                    },
                    "alert_days": {
                        "title": "Alert Window (Days)",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Certificates expiring within this many days are flagged as EXPIRING_SOON. Default is 60 days, which covers typical insurance renewal lead times.",
                        "default": 60
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
