# Hiring & Compensation Change Monitor API (`treegenesis/auditable-compensation-hiring-events`) Actor

Monitors public Greenhouse, Lever, and Ashby job boards and emits auditable, machine-readable events for material compensation and hiring changes with before/after evidence.

- **URL**: https://apify.com/treegenesis/auditable-compensation-hiring-events.md
- **Developed by:** [Tory Wilson](https://apify.com/treegenesis) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 successful source checks

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

## Auditable Compensation & Hiring Event API

TREE-001 is a deterministic Apify Actor that monitors **public** Greenhouse, Lever, and Ashby job boards and emits auditable, machine-readable material hiring events.

### Commercial contract

The Actor does not claim to know whether a position was filled, whether a company is growing, or why a posting changed. It reports observed changes from public sources, with source URLs, before/after facts, reason codes, source-completeness status, and deterministic event fingerprints.

### V1 event types

- `JOB_ADDED`
- `JOB_REMOVED_CONFIRMED` only after two consecutive complete checks
- `JOB_REOPENED`
- `COMPENSATION_CHANGED`
- `LOCATION_CHANGED`
- `WORKPLACE_TYPE_CHANGED`
- `JOB_MATERIAL_FIELDS_CHANGED`
- `DEPARTMENT_BUILDOUT`

Source failures generate free `source_error` records and never trigger removal events.

### State model

Use the same `monitorNamespace` for recurring checks. Each provider/board receives a separate persistent record in a named Apify key-value store. Named stores are required because state must survive individual Actor runs.

### Input example

```json
{
  "monitorNamespace": "portfolio-watchlist",
  "targets": [
    {"provider": "greenhouse", "board": "company-slug", "company": "Company A"},
    {"provider": "lever", "board": "company-slug", "company": "Company B", "region": "global"},
    {"provider": "ashby", "board": "company-slug", "company": "Company C"}
  ],
  "maxTargets": 25,
  "maxConcurrency": 5,
  "timeoutSeconds": 20,
  "thresholds": {"departmentAbsoluteChange": 5, "departmentPercentChange": 0.5}
}
```

### Output guarantees

- First successful run establishes a baseline and reports no historical events.
- A failed or incomplete source check does not update state.
- A missing job is not declared removed after one check.
- Material field changes include explicit before/after values.
- Event fingerprints are deterministic for the compared facts.
- Unsupported targets result in structured errors.

### Resource controls

- V1 supports only Greenhouse, Lever, and Ashby.
- No browser automation, proxies, paid APIs, or LLM calls.
- `maxTargets` defaults to 25 and is capped at 100 by the input schema.
- `maxConcurrency` is capped at 8.
- HTTP timeout is capped at 30 seconds.
- Failed sources are not billed as successful checks.

### Monetization configuration

Configure these pay-per-event events in Apify Console:

- `successful-source-check`: proposed validation price **$0.01**
- `material-event`: proposed validation price **$0.05**

These are launch hypotheses. Do not publish final prices until benchmark runs measure compute and storage costs. The code checks Apify's charge limit before pushing billable records.

### Cost benchmark procedure

1. Run three baselines containing 1, 10, and 25 boards.
2. Record compute units, wall-clock duration, dataset/storage volume, and source-success rate.
3. Repeat each set without changes.
4. Run controlled fixture-based changes to test event volume.
5. Calculate direct cost per successful board check and per material event.
6. Require a commercially sustainable contribution margin before publication.
7. Do not reduce price merely to attain the $1 Genesis milestone.

### Local tests

```bash
python -m pip install pytest pytest-asyncio httpx
pytest -q
```

### Deployment package

The repository includes:

- Apify Actor manifest
- input and dataset schemas
- Dockerfile
- source connectors
- stateful comparison engine
- pay-per-event hooks
- automated unit/connector tests
- one-time owner deployment checklist

### Legal and data boundaries

- Public job-posting data only.
- No applicant, candidate, employee, or private ATS data.
- No login bypass, cookies, credential collection, or application submission.
- No inference of protected characteristics.
- No claim that an observed event proves corporate intent or performance.
- Users are responsible for their lawful use of output and compliance with source/platform terms.

# Actor input Schema

## `monitorNamespace` (type: `string`):

Reuse the same namespace for stateful comparisons across Actor runs.

## `targets` (type: `array`):

Greenhouse, Lever, or Ashby public job-board identifiers to monitor.

## `maxTargets` (type: `integer`):

Maximum number of job-board targets processed in a single Actor run.

## `maxConcurrency` (type: `integer`):

Maximum number of public job boards checked concurrently during one Actor run.

## `timeoutSeconds` (type: `integer`):

Maximum number of seconds allowed for each public source request.

## `thresholds` (type: `object`):

Threshold settings used to determine when department hiring changes qualify as material events.

## Actor input object example

```json
{
  "monitorNamespace": "default",
  "targets": [
    {
      "provider": "greenhouse",
      "board": "example",
      "company": "Example Company"
    }
  ],
  "maxTargets": 25,
  "maxConcurrency": 5,
  "timeoutSeconds": 20,
  "thresholds": {
    "departmentAbsoluteChange": 5,
    "departmentPercentChange": 0.5
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing board summaries, material hiring events, and structured source-error records.

# 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("treegenesis/auditable-compensation-hiring-events").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("treegenesis/auditable-compensation-hiring-events").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 treegenesis/auditable-compensation-hiring-events --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,treegenesis/auditable-compensation-hiring-events"
        }
    }
}
```

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/2RpvtmfLj1oFsuoDK/builds/q4h42e6DV9ah8wP6G/openapi.json
