{
  "openapi": "3.0.1",
  "info": {
    "title": "Benchmarky — Test Actors Before You Buy",
    "description": "Rank & live-test similar Apify actors on the same input. Compare success rate, speed, cost per result & data completeness.",
    "version": "0.1",
    "x-build-id": "6dHqMqslQksZsKmgV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/skilak~benchmarky/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-skilak-benchmarky",
        "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/skilak~benchmarky/runs": {
      "post": {
        "operationId": "runs-sync-skilak-benchmarky",
        "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/skilak~benchmarky/run-sync": {
      "post": {
        "operationId": "run-sync-skilak-benchmarky",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "scorecard",
              "benchmark"
            ],
            "type": "string",
            "description": "Scorecard ranks candidates from public metadata. Live Benchmark actually RUNS the top candidates on your account — you pay their normal prices for the test runs.",
            "default": "scorecard"
          },
          "searchKeyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Find candidate actors by store search, e.g. 'instagram profile scraper'. Ignored if actorIds provided."
          },
          "actorIds": {
            "title": "Explicit actor IDs",
            "type": "array",
            "description": "Compare exactly these actors (format: username/actor-name). Overrides searchKeyword.",
            "items": {
              "type": "string"
            }
          },
          "maxCandidates": {
            "title": "Max candidates to score",
            "minimum": 2,
            "maximum": 25,
            "type": "integer",
            "description": "How many candidates to pull from the store search and score (2–25). Ignored when you pass explicit actorIds.",
            "default": 10
          },
          "benchmarkTopN": {
            "title": "[Benchmark] How many top candidates to live-test",
            "minimum": 2,
            "maximum": 5,
            "type": "integer",
            "description": "How many of the top-ranked candidates to actually run in Live Benchmark mode (2–5). Each run charges you the candidate's normal price.",
            "default": 3
          },
          "testInput": {
            "title": "[Benchmark] Test input (JSON)",
            "type": "object",
            "description": "Canonical test payload. Phase 2: must match each candidate's schema via inputMappings. Phase 3: auto-mapped by LLM."
          },
          "inputMappings": {
            "title": "[Benchmark] Per-actor input overrides (JSON)",
            "type": "object",
            "description": "Optional map of actorId -> exact input object for that actor. Bypasses auto-mapping."
          },
          "expectedFields": {
            "title": "[Benchmark] Expected output fields",
            "type": "array",
            "description": "Field names to measure completeness against, e.g. ['username','followersCount','biography']. Leave empty to auto-derive from the fields most candidates return.",
            "items": {
              "type": "string"
            }
          },
          "perActorBudgetUsd": {
            "title": "[Benchmark] Max spend per candidate run (USD)",
            "type": "string",
            "description": "Hard cap passed as maxTotalChargeUsd to each sub-run.",
            "default": "0.50"
          },
          "perActorTimeoutSecs": {
            "title": "[Benchmark] Timeout per candidate run",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Hard timeout per candidate run, in seconds (30–600). A run still going after this is aborted and marked DNF_TIMEOUT.",
            "default": 300
          },
          "maxItemsPerRun": {
            "title": "[Benchmark] Max items per candidate run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Max dataset items to pull from each candidate run (1–1000). Passed as maxItems to bound both spend and the completeness comparison.",
            "default": 20
          },
          "userApiToken": {
            "title": "[Benchmark] Your Apify API token",
            "type": "string",
            "description": "Needed only for Live Benchmark if the default run token lacks permission to start other actors. Stored encrypted; never logged."
          },
          "skipActorsRequiringSecrets": {
            "title": "Skip candidates that require external API keys",
            "type": "boolean",
            "description": "Skip candidates whose input schema requires a secret (e.g. an external API key) you'd have to supply. When off, provide an inputMappings entry for those actors or they are skipped anyway.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}