# New Jersey State Payroll - Every State Employee Payment (`j0401/nj-payroll`) Actor

Every payment New Jersey's state government made to its own workforce (public open data, 2.84M rows, 2010-today): employee, agency and section, job title, bargaining group, salary rate, and paid amounts by type. Filter by name, agency, title, year or amount.

- **URL**: https://apify.com/j0401/nj-payroll.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 new jersey payroll records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## New Jersey State Payroll - Every State Employee Payment

Every payment the State of New Jersey made to its own workforce, straight from
the State's payroll register. **2.84 million rows** - about two per employee per
reporting year (a salary record and a payments record) - from calendar 2010
through the latest reporting year.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you actually receive - the whole register stays queryable, you are
never billed for the scan behind it.

### What you get

One row per employee (an annual snapshot), with the pay attached to it:

- **Who** - employee name (last, first, middle initial), and the payroll id
- **Where** - the employing department/agency and the section inside it
- **What job** - the job title and the employee-relations (bargaining) group
- **How paid** - annual salary, hourly, part-time or per-diem
- **How much** - the paid amounts broken down by type: regular pay,
  overtime, supplemental, one-time, retroactive, lump sum, and clothing

#### Two record types, one register

The State publishes each employee in **two rows**, and the two carry different
money columns:

- **`recordType: "MASTER"`** - the salary rate (`salaryHourlyRate`), the
  original hire date (present on ~5% of MASTER rows), and the year-to-date
  totals (`masterYtdRegularPay`, `masterYtdOvertime`, `masterYtdOther`,
  `masterYtdEarnings`).
- **`recordType: "DETAIL"`** - the amounts paid in the reporting period, broken out by
  type (`regularPay`, `overtimePayments`, `retroactivePay`, `lumpSumPay`, )
  and the year-to-date `ytdEarnings`.

Neither row shows the whole picture on its own - that is how the State
publishes it. Both are returned by default; set `recordType` to read one. A
row leaves the other type's fields empty rather than dropping the keys, so the
shape never changes under you.

### Filter it

- **Name** - `lastName="Smith"`, or `fullName="Smith, John"`.
- **Agency and section** - `department="Corrections"`,
  `section="State Police"`.
- **Job** - `title="Trooper"`, `title="Nurse"`. 44 named agencies, 280 sections
  and 40 bargaining groups in total.
- **Record type** - MASTER or DETAIL (see above).
- **Year** - `calendarYear=2025`. 2010-2026 are present.
- **Amount** - `minAmount=100000` for six-figure year-to-date earnings.
- **Date range** and **last-N-days** on the snapshot date.

### Example inputs

**One employee by name** - `lastName` is a substring match.

```json
{ "lastName": "SMITH", "recordType": "DETAIL", "maxResults": 25 }
```

**One agency's payroll** - combine the agency with a job title.

```json
{ "department": "CORRECTIONS", "title": "OFFICER", "maxResults": 50 }
```

**Top earners this year** - year-to-date earnings at or above a threshold.

```json
{ "calendarYear": 2026, "minAmount": 150000, "maxResults": 50 }
```

**Where the payroll is** - `mode=aggregate` returns one count row per agency;
every group comes back.

```json
{ "mode": "aggregate", "groupBy": "department" }
```

### Or roll it up

Set `mode=aggregate` and get a rolled-up count by **department**,
**section**, **bargaining group**, **compensation method**, **calendar year**
or **record type**. Every group comes back - this mode is not cut off by
`maxResults`.

### Then follow the money

- Headcount and payroll size by agency, and how they move year over year.
- Every person the State has paid, and what they earned in each reporting year.
- Overtime vs. regular pay by agency or bargaining unit.
- The public payroll of one agency or one job title, line by line.

### Example output

**One detail row** - `department=CORRECTIONS`, `recordType=DETAIL`:

```json
{
 "platform": "nj-payroll",
 "source": "new-jersey-state-payroll",
 "mode": "rows",
 "groupKey": "",
 "groupCount": "",
 "groupBy": "",
 "calendarYear": "2026",
 "calendarQuarter": "2",
 "asOfDate": "2026-06-30T00:00:00.000",
 "payrollId": "231480",
 "lastName": "COOPER",
 "firstName": "RUSSELL",
 "middleInitial": "S",
 "fullName": "COOPER, RUSSELL S",
 "masterDepartment": "CORRECTIONS",
 "masterSection": "BAYSIDE STATE PRISON",
 "masterTitle": "STRKPR 2",
 "bargainingGroup": "ADMINISTRATIVE AND CLERICAL SERVICES (CWA) - UNIT A",
 "compensationMethod": "ANNUAL SALARY",
 "regularPay": "11199.65",
 "supplementalPay": "0",
 "oneTimePayments": "0",
 "ytdEarnings": "11199.65",
 "recordType": "DETAIL",
 "sourceUpdatedAt": "2026-08-28"
}
```

**`mode=aggregate`, `groupBy=department`** - one count row per agency:

```
HUMAN SERVICES                  408,968
JUDICIARY                       352,296
CORRECTIONS                     307,183
LAW AND PUBLIC SAFETY           267,418
CHILDREN AND FAMILIES           249,243
ENVIRONMENTAL PROTECTION        177,273
```

### Notes on the data, from the source

- **Two rows per employee per year, not one.** See the record-type section
  above: a MASTER row and a DETAIL row, with non-overlapping money columns.
- **The register is effectively annual** - the State publishes one snapshot per
  reporting year (the current year is a partial snapshot). The newest data can be
  up to a year behind. `sourceUpdatedAt` carries the
  dataset's own refresh date.
- **A few rows carry adjustments.** 17 of the 2.84 million rows are negative
  (the lowest is -$43,896.87) - real accounting entries, returned as they stand.
  Set `minAmount=0.01` for a positive-only query.
- **23,706 rows carry no department.** The State writes the literal string
  `"null"` there; it is returned as empty, not as an agency named "null".
- **Job titles and sections are free text as the State types them**, so a
  substring match is the right way to search them.

# Actor input Schema

## `lastName` (type: `string`):

Substring match on the employee's last name, e.g. 'SMITH'. Blank = any.

## `firstName` (type: `string`):

Substring match on the employee's first name. Blank = any.

## `fullName` (type: `string`):

Substring match on the combined 'LAST, FIRST MI' name, e.g. 'SMITH, JOHN'. Blank = any.

## `department` (type: `string`):

Substring match on the master (employing) department/agency, e.g. 'CORRECTIONS', 'TRANSPORTATION', 'JUDICIARY'. 44 named agencies, plus an unattributed bucket. Blank = any.

## `section` (type: `string`):

Substring match on the section within the agency, e.g. 'STATE POLICE', 'PARKS'. 280 sections in total. Blank = any.

## `title` (type: `string`):

Substring match on the job title, e.g. 'TROOPER', 'NURSE', 'ENGINEER', 'CLERK'. Blank = any.

## `bargainingGroup` (type: `string`):

Substring match on the employee-relations (union bargaining) group, e.g. 'CWA', 'PBA', 'AFSCME'. 40 groups in total. Blank = any.

## `recordType` (type: `string`):

The register holds two record types: 'MASTER' carries the salary rate and year-to-date totals, 'DETAIL' the paid amounts by type. Their money columns do not overlap. Blank = both.

## `compensationMethod` (type: `string`):

How the employee is paid. 'None Listed' is a value the State itself publishes, not a missing one. Blank = any.

## `calendarYear` (type: `integer`):

Exact calendar year of the annual snapshot, e.g. 2025. Blank = any. 2010-2026 are present.

## `asOfFrom` (type: `string`):

Earliest snapshot date, YYYY-MM-DD. Blank = any.

## `asOfTo` (type: `string`):

Latest snapshot date, YYYY-MM-DD. Blank = any.

## `minAmount` (type: `number`):

Smallest year-to-date earnings in dollars. Read from the column the record's own type carries. Blank = no lower bound. A positive-only query should set this to 0.01, since 17 rows are negative (adjustments).

## `maxAmount` (type: `number`):

Largest year-to-date earnings in dollars. Blank = no upper bound.

## `recentDays` (type: `integer`):

Only rows whose snapshot falls within the last N days. Ignored when 'Snapshot on or after' is set. 0 = off. The register is annual, so use 400+ for the latest snapshot.

## `mode` (type: `string`):

rows = payroll rows matching your filters (default). aggregate = one count row per group (see groupBy).

## `groupBy` (type: `string`):

Which dimension to aggregate over (mode=aggregate). Blank = department. Every group is returned - aggregate mode is not cut off by maxResults.

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

Cap the number of records pushed in rows mode (0 = default 50; up to 2,000 per run). Each record is metered individually, so there is no per-run charge cap. Aggregate mode returns every group.

## Actor input object example

```json
{
  "lastName": "",
  "firstName": "",
  "fullName": "",
  "department": "",
  "section": "",
  "title": "",
  "bargainingGroup": "",
  "recordType": "",
  "compensationMethod": "",
  "asOfFrom": "",
  "asOfTo": "",
  "recentDays": 0,
  "mode": "rows",
  "groupBy": "",
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

New Jersey payroll records - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (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("j0401/nj-payroll").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("j0401/nj-payroll").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 j0401/nj-payroll --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/nj-payroll"
        }
    }
}
```

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/wXfs5dC9ohoYLknEq/builds/ZAyAyDLpPN8xT4aMr/openapi.json
