# API Breaking Change Monitor (`ahampton83/openapi-breaking-change-monitor`) Actor

Compare bundled OpenAPI specs and detect breaking changes, or monitor a spec against a saved baseline.

- **URL**: https://apify.com/ahampton83/openapi-breaking-change-monitor.md
- **Developed by:** [Aaron Hampton](https://apify.com/ahampton83) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / completed comparison

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

## API Breaking Change Monitor

Compare two bundled OpenAPI specs and get path-level breaking changes. Each run returns one dataset row with the baseline and current version and fingerprint, a finding count, and up to 500 findings. Long paths or messages end in an ellipsis. The Actor reports the rules detected by the pinned oasdiff engine.

### Compare two versions

Set Current OpenAPI URL and Baseline OpenAPI URL. Leave Monitor key empty.

```json
{
  "baselineUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.0/api/openapi-spec/v3/apis__apps__v1_openapi.json",
  "currentUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.0/api/openapi-spec/v3/apis__apps__v1_openapi.json"
}
```

### Monitor a published spec

Set Current OpenAPI URL and a Monitor key, and leave Baseline OpenAPI URL empty. Run once to save the baseline. Set up an Apify task and schedule with the same input to check the URL again. Each successful comparison uses the latest saved observation and records the current spec for the next run. When the fingerprint matches the saved baseline, the check finishes without running a second diff. Use a unique, case-sensitive key per API. Use a new key to seed a fresh baseline.

```json
{
  "currentUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/v3/apis__apps__v1_openapi.json",
  "monitorKey": "kubernetes-apps-v1"
}
```

The dataset row includes a status.

- **baseline_saved** means the first monitor run successfully read and stored the spec.
- **breaking_changes** means oasdiff reported one or more breaking changes.
- **no_breaking_changes** means oasdiff reported zero breaking changes.

The Actor accepts bundled OpenAPI 3.x JSON or YAML over public HTTPS. Each spec must fit within 1 MiB both before and after normalization. Larger specs are rejected before the diff. Split a large API into smaller bundled specs and expand YAML aliases before submitting. The Actor uses up to 512 MB of memory and allows up to 20 seconds for the diff. Query strings are omitted from results. Named monitor storage retains compressed specs and observation metadata for future comparisons.

### Billing

Each completed comparison costs **$0.01**, including comparisons with zero findings. Baseline setup is free. A run that produces no completed comparison report has no comparison charge.

### Local development

Install Node.js 24 and oasdiff 1.39.0, then run npm ci. Put oasdiff on PATH or set OASDIFF_PATH to the executable. Save one of the example inputs as storage/key_value_stores/default/INPUT.json and run npm start. Run npm test for parser and baseline checks.

# Actor input Schema

## `currentUrl` (type: `string`):

A public HTTPS URL to a bundled OpenAPI 3.x JSON or YAML file up to 1 MiB.

## `baselineUrl` (type: `string`):

The baseline for a one-off comparison, up to 1 MiB. Leave blank when using a monitor key.

## `monitorKey` (type: `string`):

A name you reuse on each scheduled run, such as payments-api. Leave blank for a one-off comparison.

## Actor input object example

```json
{
  "currentUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.0/api/openapi-spec/v3/apis__apps__v1_openapi.json",
  "baselineUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.0/api/openapi-spec/v3/apis__apps__v1_openapi.json"
}
```

# Actor output Schema

## `results` (type: `string`):

One dataset row with the comparison status, spec fingerprints and path-level findings.

# 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 = {
    "currentUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.0/api/openapi-spec/v3/apis__apps__v1_openapi.json",
    "baselineUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.0/api/openapi-spec/v3/apis__apps__v1_openapi.json"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahampton83/openapi-breaking-change-monitor").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 = {
    "currentUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.0/api/openapi-spec/v3/apis__apps__v1_openapi.json",
    "baselineUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.0/api/openapi-spec/v3/apis__apps__v1_openapi.json",
}

# Run the Actor and wait for it to finish
run = client.actor("ahampton83/openapi-breaking-change-monitor").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 '{
  "currentUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.0/api/openapi-spec/v3/apis__apps__v1_openapi.json",
  "baselineUrl": "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.0/api/openapi-spec/v3/apis__apps__v1_openapi.json"
}' |
apify call ahampton83/openapi-breaking-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ahampton83/openapi-breaking-change-monitor"
        }
    }
}
```

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/D85dQmajG27DfmORd/builds/TxwyRA9LwtSr5b6vV/openapi.json
