{
  "openapi": "3.0.1",
  "info": {
    "title": "Selenium Cloud Runner",
    "description": "Selenium Cloud Runner scrapes JavaScript-heavy websites using Selenium and headless Chrome. It extracts data with CSS or XPath rules, supports scrolling, popup handling, screenshots, proxies, retries, and structured dataset exports.",
    "version": "0.0",
    "x-build-id": "ncPq76yOPwtsETnyr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovanza.inc~selenium-cloud-runner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovanza.inc-selenium-cloud-runner",
        "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/sovanza.inc~selenium-cloud-runner/runs": {
      "post": {
        "operationId": "runs-sync-sovanza.inc-selenium-cloud-runner",
        "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/sovanza.inc~selenium-cloud-runner/run-sync": {
      "post": {
        "operationId": "run-sync-sovanza.inc-selenium-cloud-runner",
        "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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Start URLs",
            "type": "array",
            "description": "One or more URLs to open in Selenium and extract data from (one per line).",
            "items": {
              "type": "string"
            }
          },
          "maxRetries": {
            "title": "Max retries per URL",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry a URL if navigation/extraction fails.",
            "default": 2
          },
          "retryDelaySecs": {
            "title": "Retry delay (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Sleep between retries.",
            "default": 3
          },
          "headless": {
            "title": "Headless mode",
            "type": "boolean",
            "description": "Run Chrome in headless mode (recommended on Apify).",
            "default": true
          },
          "pageLoadTimeoutSecs": {
            "title": "Page load timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum time to wait for page navigation.",
            "default": 60
          },
          "waitForSelector": {
            "title": "Wait for selector (CSS or XPath)",
            "type": "string",
            "description": "Optional selector to wait for after navigation. If it starts with // or (.// it is treated as XPath; otherwise CSS.",
            "default": "body"
          },
          "waitTimeoutSecs": {
            "title": "Wait timeout (seconds)",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum time to wait for waitForSelector.",
            "default": 25
          },
          "closeSelectors": {
            "title": "Close popups (CSS selectors)",
            "type": "array",
            "description": "CSS selectors to click (best-effort) to close popups/modals after page load.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "scroll": {
            "title": "Scrolling / infinite scroll",
            "type": "object",
            "description": "Optional scrolling behavior for pages that load content dynamically.",
            "default": {
              "enabled": false,
              "maxRounds": 10,
              "scrollBy": 900,
              "pauseSecs": 1,
              "stopOnNoNewHeightRounds": 2
            }
          },
          "extract": {
            "title": "Extraction rules",
            "type": "array",
            "description": "Flexible extraction config. Each rule uses CSS or XPath and extracts text/HTML/attributes.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "title": "Field name",
                  "type": "string",
                  "description": "Field name in output item.",
                  "editor": "textfield"
                },
                "selector": {
                  "title": "Selector (CSS or XPath)",
                  "type": "string",
                  "description": "CSS selector or XPath (starting with // or (.//).",
                  "editor": "textfield"
                },
                "type": {
                  "title": "Extract type",
                  "type": "string",
                  "description": "What to extract from the matched element(s).",
                  "editor": "select",
                  "enum": [
                    "text",
                    "html",
                    "attr"
                  ]
                },
                "attr": {
                  "title": "Attribute name",
                  "type": "string",
                  "description": "Attribute name (required when type=attr).",
                  "editor": "textfield"
                },
                "all": {
                  "title": "Extract all matches",
                  "type": "boolean",
                  "description": "If true, extract all matches as list. If false, first match only.",
                  "editor": "checkbox",
                  "default": false
                }
              },
              "required": [
                "name",
                "selector",
                "type"
              ]
            },
            "default": [
              {
                "name": "title",
                "selector": "title",
                "type": "text",
                "all": false
              },
              {
                "name": "h1",
                "selector": "h1",
                "type": "text",
                "all": false
              }
            ]
          },
          "includeHtml": {
            "title": "Include full HTML",
            "type": "boolean",
            "description": "If enabled, store full page HTML in the dataset item (can be large).",
            "default": false
          },
          "includeVisibleText": {
            "title": "Include visible text",
            "type": "boolean",
            "description": "If enabled, store visible page text (body.innerText).",
            "default": true
          },
          "takeScreenshot": {
            "title": "Take screenshot",
            "type": "boolean",
            "description": "If enabled, takes a PNG screenshot and stores it in the default key-value store (key includes index).",
            "default": false
          },
          "saveCsvToKeyValueStore": {
            "title": "Save CSV (key-value store)",
            "type": "boolean",
            "description": "If enabled, writes a CSV summary of dataset items to the default key-value store as OUTPUT.csv.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings (recommended for tougher targets)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}