{
  "openapi": "3.0.1",
  "info": {
    "title": "CSS Selector Extractor for JavaScript Sites (Browser)",
    "description": "Extract any CSS selector from pages that need JavaScript: a real Chromium browser renders each page, waits for content, scrolls or clicks \"load more\", then returns text, HTML, attributes, tables or counts. One row per page, pay per page. For static pages use the cheaper CSS Selector Extractor.",
    "version": "0.0",
    "x-build-id": "SruWrJmBDqlvgQdP1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdatatools~css-selector-extractor-js/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdatatools-css-selector-extractor-js",
        "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/webdatatools~css-selector-extractor-js/runs": {
      "post": {
        "operationId": "runs-sync-webdatatools-css-selector-extractor-js",
        "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/webdatatools~css-selector-extractor-js/run-sync": {
      "post": {
        "operationId": "run-sync-webdatatools-css-selector-extractor-js",
        "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": {
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Enter one URL per row. Each page is opened in a real Chromium browser, JavaScript runs, and the selectors are read from the rendered HTML. Each page gets exactly one result row, even if loading fails. Rows are saved as pages finish; if the run timeout comes first, the run stops early and still ends SUCCEEDED.",
            "default": [
              "https://quotes.toscrape.com/js/"
            ],
            "items": {
              "type": "string"
            }
          },
          "selectors": {
            "title": "Selectors",
            "type": "array",
            "description": "Enter the fields to extract as a JSON array of {\"name\", \"selector\", \"type\"} objects, read from the rendered page. \"type\" is text, html, attr, count or table; \"attr\" also needs \"attribute\" (e.g. {\"name\":\"canonicalUrl\",\"selector\":\"link[rel='canonical']\",\"type\":\"attr\",\"attribute\":\"href\"}). \"table\" returns the matched <table> as an array of row objects keyed by its header row. Capped at 25 entries per run.",
            "default": [
              {
                "name": "text",
                "selector": ".text",
                "type": "text"
              },
              {
                "name": "author",
                "selector": ".author",
                "type": "text"
              }
            ]
          },
          "firstMatchOnly": {
            "title": "First match only",
            "type": "boolean",
            "description": "Keep this on to return only the first element each selector matches. Turn it off to return every match (up to Max matches per selector) as an array.",
            "default": true
          },
          "maxMatchesPerSelector": {
            "title": "Max matches per selector",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Enter the most matches to return for one selector when First match only is off, e.g. 20. Does not limit the reported match count, only how many values are returned.",
            "default": 20
          },
          "trimWhitespace": {
            "title": "Trim whitespace",
            "type": "boolean",
            "description": "Keep this on to collapse runs of whitespace and trim the ends of extracted text and attribute values. Turning it off returns text and attr values exactly as found in the page.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Enter how many pages to render in parallel (each one is a browser tab). Default 3 fits the default 1024 MB memory; raise it only with more memory. Capped at 10.",
            "default": 3
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Optional. A CSS selector that must appear before the page is read, e.g. \".quote\". If it does not appear within the wait timeout the page is read anyway and the row notes it in \"renderNotes\"."
          },
          "waitTimeoutSecs": {
            "title": "Wait timeout (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "How long to wait for the \"Wait for selector\" element, e.g. 15.",
            "default": 15
          },
          "waitUntil": {
            "title": "Page load event",
            "enum": [
              "domcontentloaded",
              "load",
              "networkidle"
            ],
            "type": "string",
            "description": "When navigation counts as loaded. 'domcontentloaded' is fastest; 'load' (default) waits for images and scripts; 'networkidle' waits until the network is quiet (slow on busy pages).",
            "default": "load"
          },
          "scrollToBottom": {
            "title": "Scroll to bottom (infinite scroll)",
            "type": "boolean",
            "description": "Scroll to the bottom of the page repeatedly so infinite-scroll content loads. Stops when the page stops growing or after Max scrolls.",
            "default": false
          },
          "maxScrolls": {
            "title": "Max scrolls",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Most scroll steps per page when \"Scroll to bottom\" is on, e.g. 10.",
            "default": 10
          },
          "clickSelector": {
            "title": "Click selector (load more)",
            "type": "string",
            "description": "Optional. A button or link to click repeatedly to load more content, e.g. \"button.load-more\". Clicking stops when the element is gone or hidden."
          },
          "maxClicks": {
            "title": "Max clicks",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Most clicks per page for \"Click selector\", e.g. 5.",
            "default": 5
          },
          "blockResources": {
            "title": "Block images, fonts and media",
            "type": "boolean",
            "description": "Blocks images, fonts and video while rendering: faster and cheaper (less traffic). Turn it off only if the data you need is loaded by those resources.",
            "default": true
          },
          "itemSelector": {
            "title": "Item selector (list pages)",
            "type": "string",
            "description": "Optional. A CSS selector for repeated items, e.g. \".quote\" or \"div.product-card\". When set, each matching element becomes one object in the row's \"items\" array, and every selector above is searched only inside that element. The row is still one per page."
          },
          "maxItemsPerPage": {
            "title": "Max items per page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Optional. Most items to return per page in item mode (default 200). \"itemCount\" always reports the full number."
          },
          "linkSelector": {
            "title": "Link selector (follow links)",
            "type": "string",
            "description": "Optional. A CSS selector for links to follow, e.g. \"a.next\" for pagination or \"a.product-link\" for detail pages. Every followed page is extracted the same way and billed as one page. Capped by Max pages."
          },
          "sitemapUrls": {
            "title": "Sitemap URLs",
            "type": "array",
            "description": "Optional. Sitemap or sitemap-index URLs, e.g. https://example.com/sitemap.xml. Every page URL listed (gzip and nested indexes handled) is added to the run, capped by Max pages.",
            "items": {
              "type": "string"
            }
          },
          "urlPattern": {
            "title": "URL pattern",
            "type": "string",
            "description": "Optional regular expression. Only followed links and sitemap URLs matching it are processed, e.g. \"/products/\"."
          },
          "urlTemplate": {
            "title": "URL template (pagination)",
            "type": "string",
            "description": "Optional. A URL with a {page} placeholder, e.g. \"https://books.toscrape.com/catalogue/page-{page}.html\". One URL per page number in Page range is added to the run (up to 10,000), after the URLs above. Each page is one result."
          },
          "pageRange": {
            "title": "Page range",
            "type": "object",
            "description": "Used with URL template: {\"from\": 1, \"to\": 10} and optionally \"step\" (e.g. 20 for offset-style URLs like ?start={page}). Inclusive; from defaults to 1."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional. Total page cap when following links or reading sitemaps (default 100). Plain URL lists are not capped by this."
          },
          "sameDomainOnly": {
            "title": "Stay on the same domain",
            "type": "boolean",
            "description": "Only follow links on the same host as the page they were found on (default on)."
          },
          "includeMetadata": {
            "title": "Include page metadata",
            "type": "boolean",
            "description": "Add a \"metadata\" object to each row: title, description, canonical URL, language, Open Graph tags and parsed JSON-LD (schema.org) blocks."
          },
          "headers": {
            "title": "Request headers",
            "type": "object",
            "description": "Optional. Extra HTTP headers sent with every page request, e.g. {\"Accept-Language\": \"de-DE\", \"Authorization\": \"Bearer …\"}. A \"User-Agent\" here replaces the default one. Values are never written to the log."
          },
          "cookies": {
            "title": "Cookies",
            "type": "array",
            "description": "Optional. Cookies sent with every page request, as [\"name=value\", …] or the [{\"name\": …, \"value\": …}] list a browser cookie-export extension produces (domain and path are ignored). Values are never written to the log; a raw Cookie header can also go in Request headers."
          },
          "proxyMode": {
            "title": "Proxy mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "'auto' (default) and 'never' load every page directly; a blocked page is reported as an error row, not retried through the proxy. 'always' routes every page through Apify Proxy (paid by traffic). Use 'always' when the target blocks datacenter IPs.",
            "default": "auto"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Which Apify Proxy group to use when 'Proxy mode' is 'always'. Leave Residential selected (the default). Not needed when running locally with your own IP.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "inputDatasetId": {
            "title": "Input dataset ID (optional)",
            "type": "string",
            "description": "Take the items from another Actor run's dataset, e.g. \"aBcD1234\". Combined with the list above."
          },
          "inputField": {
            "title": "Field to read from that dataset",
            "type": "string",
            "description": "Column holding the value, e.g. \"url\" (the default). Array columns are flattened."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}