# Jenkins Controller Extractor (`datamule/jenkins-controller-extractor`) Actor

Point at any Jenkins or Hudson controller (anonymous-read) and get one structured row per job or build: status, results, timings, build history, job graph. Works on any controller via the standard /api/json Remote Access API.

- **URL**: https://apify.com/datamule/jenkins-controller-extractor.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools, Business
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 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/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

## Jenkins Controller Extractor

Point at **any** Jenkins or Hudson controller and get clean, structured data out
of its standard **Remote Access API** (`/api/json`) — no per-host scraper, no
setup. Every Jenkins controller (the dominant self-hosted CI server) speaks the
identical documented API, and a large population of open-source project
controllers leaves anonymous read enabled, so their **job graph and build
history** are yours in one call.

### What it does

Three modes, auto-selected from your input:

| Mode | When | Output |
|------|------|--------|
| **jobs** (default) | just a `baseUrl` | one row per job on the whole controller, each with its last-build result, status, and timings. Jenkins **folders** are recursed into so nested jobs surface too. |
| **builds** | set a `job` | one row per recent build of that single job — result, duration, timestamp, building flag. |
| **discovery** | `mode = discovery` | one row describing the controller itself — Jenkins version, job count, node mode, security. |

### Input

- **baseUrl** (required) — the controller root, e.g. `https://jenkins.debian.net`
  or `https://ci.adoptium.net`. The `/api/json` path is added for you.
- **mode** — `jobs` (default) · `builds` · `discovery`. Leave empty to
  auto-select (jobs, or builds when a `job` is set).
- **job** — (builds mode) a job name, a nested `folder/child` path, or a full job
  URL.
- **buildDepth** — (builds mode) how many recent builds to fetch (default 10).
- **foldersRecurse** / **maxFolderDepth** — (jobs mode) recurse into folders
  (default on, depth 3).
- **maxRecords** — a global cap on rows (each row is one billable event).
- **bearer** / **extraHeaders** — optional auth for a private / rate-limited
  controller. Never required for public controllers; never logged.

### Output

One flat row per job or build. Jobs carry: `jobName`, `jobType`
(freestyle / pipeline / multibranch / matrix / maven / folder / …), `jobClass`,
`folderPath`, `url`, `color`, `statusText`, `buildable`, `inQueue`, and a
`lastBuild*` summary (number, result, timestamp, duration, url). Builds carry:
`buildNumber`, `result`, `timestamp`, `durationMs`, `building`, `url`. Every row
also has controller meta (`_source`, `_software`, `_version`, `_jobCount`) and a
lossless `_raw` copy of the original API entry. Timestamps are ISO-8601 UTC.

### Notes

- Works on any controller that allows **anonymous read** of its API. For gated
  controllers, supply a `bearer` token or `extraHeaders`.
- A controller with no jobs, or a job with no build history, returns 0 rows and a
  clean run — it never invents data.
- Pay-per-event: one event per row returned.

### Example

```json
{ "baseUrl": "https://jenkins.debian.net", "maxRecords": 25 }
````

```json
{ "baseUrl": "https://ci.adoptium.net", "job": "build-scripts/openjdk21-pipeline", "buildDepth": 20 }
```

# Actor input Schema

## `baseUrl` (type: `string`):

Root URL of a Jenkins or Hudson controller. Every Jenkins controller exposes the identical Remote Access API at /api/json, so one actor works against any of them: https://jenkins.debian.net, https://ci.adoptium.net, or any self-hosted / corporate / university controller that allows anonymous read. The /api/json path is appended for you (paste the controller root). The run MODE is chosen automatically from the other fields you set (see below).

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

What to extract. jobs (default): one row per job on the whole controller, with each job's last-build result. builds: the recent build history of ONE job (set the Job field) — one row per build. discovery: a single row describing the controller itself (Jenkins version, job count, security mode). Leave unset to auto-select: jobs, unless a Job is set (then builds). Pick a value here to force a specific mode (e.g. discovery).

## `job` (type: `string`):

BUILDS MODE. The job whose recent build history to fetch. Accepts a simple job name (my-job), a nested folder path (my-folder/my-job), or a full job URL (https://ci.adoptium.net/job/build-scripts/job/openjdk21-pipeline/). Setting this auto-selects builds mode. One row is emitted per build (result, timing, timestamp).

## `buildDepth` (type: `integer`):

BUILDS MODE. How many of the most recent builds to fetch for the Job (newest first). Default 10. Capped at 500. Ignored in jobs / discovery mode.

## `foldersRecurse` (type: `boolean`):

JOBS MODE. Jenkins organizes jobs into folders (Folder / Organization Folder plugins). When true (default), the actor recurses into folder jobs to surface the nested jobs too, up to the Max folder depth. When false, only the jobs at the controller root level are returned (folders appear as single rows).

## `maxFolderDepth` (type: `integer`):

JOBS MODE. How many levels of nested folders to recurse into when Recurse into folders is on. Default 3, capped at 8. A controller with deep folder trees (e.g. multibranch pipelines) may nest several levels.

## `maxRecords` (type: `integer`):

A GLOBAL cap across jobs and builds. The default and prefill cap the run at 25 rows. Each emitted row is one `record` PPE event at the current FREE unit price of $0.0005, so the maximum example event charge is $0.0125, excluding Apify infrastructure cost. Jobs-mode folder recursion and builds-mode history stop deterministically as soon as the global cap is reached; lower it for a smaller sample or explicitly raise it for broader extraction.

## `bearer` (type: `string`):

Optional access token for a private / registration-required / rate-limited controller (sent as Authorization: Bearer \*\*\*). Not required for public controllers that allow anonymous read. Never logged.

## `extraHeaders` (type: `object`):

Optional extra HTTP headers as a JSON object, e.g. {"Jenkins-Crumb": "..."} or a cookie for gated controllers. Not required for public controllers. Header values are never logged.

## Actor input object example

```json
{
  "baseUrl": "https://jenkins.debian.net",
  "buildDepth": 10,
  "foldersRecurse": true,
  "maxFolderDepth": 3,
  "maxRecords": 25
}
```

# 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 = {
    "baseUrl": "https://jenkins.debian.net",
    "maxRecords": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/jenkins-controller-extractor").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 = {
    "baseUrl": "https://jenkins.debian.net",
    "maxRecords": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("datamule/jenkins-controller-extractor").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 '{
  "baseUrl": "https://jenkins.debian.net",
  "maxRecords": 25
}' |
apify call datamule/jenkins-controller-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Jenkins Controller Extractor",
        "description": "Point at any Jenkins or Hudson controller (anonymous-read) and get one structured row per job or build: status, results, timings, build history, job graph. Works on any controller via the standard /api/json Remote Access API.",
        "version": "0.1",
        "x-build-id": "xByzjZL94fgRn4o7V"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamule~jenkins-controller-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamule-jenkins-controller-extractor",
                "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/datamule~jenkins-controller-extractor/runs": {
            "post": {
                "operationId": "runs-sync-datamule-jenkins-controller-extractor",
                "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/datamule~jenkins-controller-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-datamule-jenkins-controller-extractor",
                "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": [
                    "baseUrl"
                ],
                "properties": {
                    "baseUrl": {
                        "title": "Jenkins controller URL",
                        "type": "string",
                        "description": "Root URL of a Jenkins or Hudson controller. Every Jenkins controller exposes the identical Remote Access API at /api/json, so one actor works against any of them: https://jenkins.debian.net, https://ci.adoptium.net, or any self-hosted / corporate / university controller that allows anonymous read. The /api/json path is appended for you (paste the controller root). The run MODE is chosen automatically from the other fields you set (see below)."
                    },
                    "mode": {
                        "title": "Run mode",
                        "enum": [
                            "jobs",
                            "builds",
                            "discovery"
                        ],
                        "type": "string",
                        "description": "What to extract. jobs (default): one row per job on the whole controller, with each job's last-build result. builds: the recent build history of ONE job (set the Job field) — one row per build. discovery: a single row describing the controller itself (Jenkins version, job count, security mode). Leave unset to auto-select: jobs, unless a Job is set (then builds). Pick a value here to force a specific mode (e.g. discovery)."
                    },
                    "job": {
                        "title": "Job (MODE: builds)",
                        "type": "string",
                        "description": "BUILDS MODE. The job whose recent build history to fetch. Accepts a simple job name (my-job), a nested folder path (my-folder/my-job), or a full job URL (https://ci.adoptium.net/job/build-scripts/job/openjdk21-pipeline/). Setting this auto-selects builds mode. One row is emitted per build (result, timing, timestamp)."
                    },
                    "buildDepth": {
                        "title": "Builds per job (MODE: builds)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "BUILDS MODE. How many of the most recent builds to fetch for the Job (newest first). Default 10. Capped at 500. Ignored in jobs / discovery mode.",
                        "default": 10
                    },
                    "foldersRecurse": {
                        "title": "Recurse into folders (MODE: jobs)",
                        "type": "boolean",
                        "description": "JOBS MODE. Jenkins organizes jobs into folders (Folder / Organization Folder plugins). When true (default), the actor recurses into folder jobs to surface the nested jobs too, up to the Max folder depth. When false, only the jobs at the controller root level are returned (folders appear as single rows).",
                        "default": true
                    },
                    "maxFolderDepth": {
                        "title": "Max folder depth (MODE: jobs)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "JOBS MODE. How many levels of nested folders to recurse into when Recurse into folders is on. Default 3, capped at 8. A controller with deep folder trees (e.g. multibranch pipelines) may nest several levels.",
                        "default": 3
                    },
                    "maxRecords": {
                        "title": "Max records (global cap)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "A GLOBAL cap across jobs and builds. The default and prefill cap the run at 25 rows. Each emitted row is one `record` PPE event at the current FREE unit price of $0.0005, so the maximum example event charge is $0.0125, excluding Apify infrastructure cost. Jobs-mode folder recursion and builds-mode history stop deterministically as soon as the global cap is reached; lower it for a smaller sample or explicitly raise it for broader extraction.",
                        "default": 25
                    },
                    "bearer": {
                        "title": "Bearer token",
                        "type": "string",
                        "description": "Optional access token for a private / registration-required / rate-limited controller (sent as Authorization: Bearer ***). Not required for public controllers that allow anonymous read. Never logged."
                    },
                    "extraHeaders": {
                        "title": "Extra request headers",
                        "type": "object",
                        "description": "Optional extra HTTP headers as a JSON object, e.g. {\"Jenkins-Crumb\": \"...\"} or a cookie for gated controllers. Not required for public controllers. Header values are never logged."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
