# SpecBreak Monitor (`rayanna/my-actor`) Actor

Detect breaking changes in OpenAPI 3.x specs. Create baselines, compare scheduled checks, and receive structured evidence with severity, JSON Pointer, before/after values, SHA-256 provenance, datasets, and optional webhooks.

- **URL**: https://apify.com/rayanna/my-actor.md
- **Developed by:** [Ray Ana](https://apify.com/rayanna) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 successful spec checks

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## SpecBreak Monitor

SpecBreak Monitor is a private-ready Apify Actor that watches OpenAPI 3.x documents, stores a baseline, and reports breaking API contract changes before downstream clients discover them in production.

It is designed as a self-service paid automation: a customer supplies one or more public OpenAPI URLs, schedules the Actor, and receives structured results in an Apify dataset or an optional HTTPS webhook. Apify handles execution, schedules, usage billing, and delivery. The Actor makes no AI-model calls, so variable costs stay low and results are deterministic.

### What it detects

- Removed paths and HTTP operations
- Removed response status codes or media types
- New required query, header, cookie, or path parameters
- Removed parameters and parameter type changes
- Newly required request bodies or request properties
- Removed response properties
- Schema type and format changes
- Narrowed enum values
- Security requirements added or changed
- New deprecation markers

Every change includes a severity, stable change code, JSON Pointer, before/after evidence, and a breaking/non-breaking flag. Each run also records SHA-256 hashes for the baseline and current documents.

### Automatic money and delivery flow

1. A customer finds the Actor in Apify Store and supplies public OpenAPI spec URLs.
2. The customer runs it once to establish a baseline, then uses an Apify schedule for recurring checks.
3. Each successful spec check triggers the `spec-check` pay-per-event charge.
4. The Actor stores the current baseline, writes a structured dataset result, and optionally sends a webhook only when changes exist.
5. Apify bills the customer and settles eligible developer payouts after account and identity setup.

The pricing hypothesis in the prepared listing is **$0.05 per successful spec check**, including platform usage. It is a starting test, not a revenue guarantee.

### Quick local demo

```bash
PYTHONPATH=src python -m specbreak.cli \
  examples/petstore-v1.json \
  examples/petstore-v2.json \
  --json-out build/sample-report.json \
  --markdown-out build/sample-report.md
```

### Test

```bash
PYTHONPATH=src python -m unittest discover -s tests -v
```

### Actor input

```json
{
  "specs": [
    {
      "name": "Billing API",
      "url": "https://api.example.com/openapi.json"
    }
  ],
  "updateBaseline": true,
  "failOnBreaking": false,
  "webhookUrl": "https://hooks.example.com/openapi-change"
}
```

Inline JSON specs are supported with a `spec` object instead of `url`. URLs containing credentials are rejected, query strings are redacted from outputs, redirects are revalidated, and localhost/private/link-local/reserved IP targets are blocked.

### Output states

- `baseline_created`: first successful observation; no alert
- `no_change`: current SHA-256 matches the stored baseline
- `changes_detected`: one or more structured changes were found
- `error`: that spec failed validation or retrieval; other specs continue

### Limits and scope

- OpenAPI 3.x JSON and YAML are supported.
- Remote `$ref` documents are not fetched; local `#/...` references are resolved.
- This detects contract risk from the document diff. It does not prove that an implementation conforms to either document.
- Public HTTP can be enabled explicitly, but HTTPS is the default and recommended mode.
- URL controls reduce SSRF risk but should still be paired with Apify limited permissions and normal platform isolation.

### Private deployment

The package is complete and tested locally. The remaining owner-only steps are listed in [docs/PUBLISH\_CHECKLIST.md](docs/PUBLISH_CHECKLIST.md). No repository, Actor, or listing has been made public.

### License

Copyright © 2026. All rights reserved. Commercial use is intended through the owner's published Apify Actor.

# Actor input Schema

## `specs` (type: `array`):

Up to 20 items. Each item needs a name and either an HTTPS url or inline spec object.

## `updateBaseline` (type: `boolean`):

Recommended for scheduled monitoring so an alert is emitted once per new document version.

## `failOnBreaking` (type: `boolean`):

Useful as a release gate. Results are still saved before the run fails.

## `webhookUrl` (type: `string`):

HTTPS endpoint called only when a document changed. Store sensitive URLs in a private Task input.

## `baselineStoreName` (type: `string`):

Named Apify key-value store used across runs.

## `allowHttp` (type: `boolean`):

Applies only to OpenAPI spec URLs. Disabled by default; webhooks always require HTTPS.

## Actor input object example

```json
{
  "specs": [
    {
      "name": "Swagger Petstore",
      "url": "https://petstore3.swagger.io/api/v3/openapi.json"
    }
  ],
  "updateBaseline": true,
  "failOnBreaking": false,
  "baselineStoreName": "specbreak-baselines",
  "allowHttp": false
}
```

# Actor output Schema

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

All structured reports written to the default dataset.

# 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 = {
    "specs": [
        {
            "name": "Swagger Petstore",
            "url": "https://petstore3.swagger.io/api/v3/openapi.json"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rayanna/my-actor").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 = { "specs": [{
            "name": "Swagger Petstore",
            "url": "https://petstore3.swagger.io/api/v3/openapi.json",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("rayanna/my-actor").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 '{
  "specs": [
    {
      "name": "Swagger Petstore",
      "url": "https://petstore3.swagger.io/api/v3/openapi.json"
    }
  ]
}' |
apify call rayanna/my-actor --silent --output-dataset

```

## MCP server setup

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

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/9jHjw2lzM6d0sd91S/builds/9CjerqASK1aAbcjYd/openapi.json
