{
  "openapi": "3.0.1",
  "info": {
    "title": "Quality Monitor — Actor Quality Scorer",
    "description": "Apifyforge Quality Monitor. Available on the Apify Store with pay-per-event pricing.",
    "version": "1.1",
    "x-build-id": "BQwpBQmZ9lLPPqNvE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~actor-quality-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-actor-quality-monitor",
        "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/ryanclinton~actor-quality-monitor/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-actor-quality-monitor",
        "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/ryanclinton~actor-quality-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-actor-quality-monitor",
        "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",
        "properties": {
          "apifyToken": {
            "title": "Apify API Token",
            "type": "string",
            "description": "Your Apify API token. Leave empty when running on Apify — your token is injected automatically. Only needed for local testing."
          },
          "auditMode": {
            "title": "Audit mode",
            "enum": [
              "fleet",
              "singleActor",
              "prePublish",
              "regressionOnly",
              "storeOptimization"
            ],
            "type": "string",
            "description": "Job-to-be-done mode. 'fleet' audits and emits every actor (worst-first). 'singleActor' audits only the actors in Actor IDs (faster, fewer charges). 'prePublish' emits only actors that are not storeReady (your publish blockers). 'regressionOnly' emits only actors whose score dropped since the last scan. 'storeOptimization' orders actors by Store-discoverability weakness (SEO + schema + docs) first. Fleet stats always cover the full scanned set; modes only change which actors the dataset emits.",
            "default": "fleet"
          },
          "actorIds": {
            "title": "Actor IDs",
            "type": "array",
            "description": "Actor IDs or names to scope the scan to (used by 'singleActor' and 'prePublish' modes). Accepts bare names or 'username/name' form. Leave empty to scan the whole account.",
            "items": {
              "type": "string"
            }
          },
          "minQualityScore": {
            "title": "Minimum Quality Score Alert Threshold",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Actors scoring below this threshold will be flagged with alert: true. Set to 0 to disable alerts.",
            "default": 0
          },
          "includeLlmOptimization": {
            "title": "Include LLM cost optimization",
            "type": "boolean",
            "description": "Also analyze the latest successful run dataset for the worst-scoring actors and produce LLM token-cost optimization recommendations (drop low-value fields, truncate long fields, estimate token savings). Requires a personal API token in the apifyToken field — the platform's auto-injected run token cannot read other actors' run datasets, so this is skipped on the platform unless you supply your own token.",
            "default": false
          },
          "llmOptimizationWorstN": {
            "title": "LLM optimization scope (worst N actors)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "When LLM optimization is enabled, analyze only the N lowest-scoring actors (they are the likeliest to benefit). Default 10. Ignored when includeLlmOptimization is false.",
            "default": 10
          },
          "includeDeepSeoAudit": {
            "title": "Include deep Store SEO audit",
            "type": "boolean",
            "description": "Also run an 11-check fine-grained Store SEO audit on every actor (title length, description length, README presence/length, categories, pricing, input/dataset schema, icon, example output in README, plus a readmeSummary lead-quality audit that scores the LLM-generated summary Apify Store ranking likely consumes). Attached to each actor as a deepSeoAudit field with per-check pass/warn/fail and a normalized 100-point score. Zero extra API cost — uses the same metadata already fetched for the main quality score.",
            "default": false
          },
          "includeRepairArtifacts": {
            "title": "Include repair artifacts",
            "type": "boolean",
            "description": "Attach a deterministic repairArtifacts object to each actor: an SEO title/description suggestion (your own metadata trimmed to the Store limits), a README section checklist (the detected missing sections), and a minimal dataset-schema stub when the actor has none. No LLM — copy-paste fix material, not generated copy.",
            "default": false
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL",
            "type": "string",
            "description": "Optional. POST threshold-crossing alerts to this URL when an actor's grade downgrades, drops below minQualityScore, or loses >= dimensionDropThreshold points in any dimension compared to the previous scan. Alerts fire only on CHANGES, not on static below-threshold state. Compatible with Slack (use an Incoming Webhook), Zapier, Make, or any HTTPS endpoint that accepts JSON. Leave empty to skip webhook delivery."
          },
          "dimensionDropThreshold": {
            "title": "Dimension drop threshold",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum points a single dimension must drop to trigger a dimensionDrop alert. Lower values are more sensitive (more alerts); higher values surface only material regressions. Default 15 (roughly \"lost a letter grade in one area\").",
            "default": 15
          },
          "scoringWeights": {
            "title": "Custom scoring weights (advanced)",
            "type": "object",
            "description": "Optional. Override the per-dimension weights used to compute each actor's overall quality score. Provide only the dimensions you want to change (any of: reliability, documentation, pricing, schemaAndStructure, seoAndDiscoverability, trustworthiness, easeOfUse, agenticReadiness); the rest keep their defaults. Values are relative ratios, not fractions — the full set is renormalized to sum to 1, so {\"reliability\": 2, \"pricing\": 1} just means reliability counts twice as much as pricing. Leave empty to use the default weighting (reliability 0.25, documentation 0.20, pricing 0.15, schema 0.10, SEO 0.10, trust 0.08, ease 0.07, agentic 0.05)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}