{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Data To Excel Scraper",
    "description": "Extract user-defined fields from repeated records on public static webpages. Normalize text, numbers, dates, booleans, and URLs into validated dataset rows and a filterable XLSX workbook.",
    "version": "0.1",
    "x-build-id": "KLJP8Qe6klwIwJ1hY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~schema-guided-web-data-to-excel/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-schema-guided-web-data-to-excel",
        "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/automation-lab~schema-guided-web-data-to-excel/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-schema-guided-web-data-to-excel",
        "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/automation-lab~schema-guided-web-data-to-excel/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-schema-guided-web-data-to-excel",
        "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": [
          "startUrls",
          "recordSelector",
          "fields"
        ],
        "properties": {
          "startUrls": {
            "title": "Public webpage URLs",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "Static, anonymously reachable HTTP(S) pages that contain the same kind of repeated records. Up to 50 URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "recordSelector": {
            "title": "Record CSS selector",
            "minLength": 1,
            "type": "string",
            "description": "CSS selector for each repeated record, evaluated against every page.",
            "default": "article.product_pod"
          },
          "fields": {
            "title": "Field schema",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "Columns to extract relative to each matched record. Field names become Excel column names.",
            "items": {
              "type": "object",
              "required": [
                "name",
                "type"
              ],
              "properties": {
                "name": {
                  "title": "Column name",
                  "description": "Unique Excel-safe name beginning with a letter and containing only letters, numbers, or underscores.",
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                },
                "selector": {
                  "title": "Field CSS selector",
                  "description": "Selector relative to the record. Omit it to read the record element itself.",
                  "type": "string"
                },
                "source": {
                  "title": "Value source",
                  "description": "Read visible text, inner HTML, or an HTML attribute.",
                  "type": "string",
                  "enum": [
                    "text",
                    "html",
                    "attribute"
                  ],
                  "default": "text"
                },
                "attribute": {
                  "title": "Attribute name",
                  "description": "Required when source is attribute, for example href, src, or title.",
                  "type": "string"
                },
                "type": {
                  "title": "Output type",
                  "description": "Normalize the value as a string, number, integer, boolean, absolute URL, or ISO date.",
                  "type": "string",
                  "enum": [
                    "string",
                    "number",
                    "integer",
                    "boolean",
                    "url",
                    "date"
                  ]
                },
                "pattern": {
                  "title": "Extraction pattern",
                  "description": "Optional regular expression. The first capture group is used when present.",
                  "type": "string",
                  "maxLength": 200
                },
                "required": {
                  "title": "Required field",
                  "description": "Add a validation warning when the field is missing or cannot be converted.",
                  "type": "boolean",
                  "default": false
                },
                "multiple": {
                  "title": "Combine all matches",
                  "description": "Extract every matching element and join values into one cell.",
                  "type": "boolean",
                  "default": false
                },
                "delimiter": {
                  "title": "Multiple-value delimiter",
                  "description": "Separator used when combining multiple matches.",
                  "type": "string",
                  "default": ", "
                },
                "fallback": {
                  "title": "Fallback value",
                  "description": "Optional value to normalize when the selector returns no content.",
                  "type": "string"
                }
              }
            },
            "default": [
              {
                "name": "title",
                "selector": "h3 a",
                "source": "attribute",
                "attribute": "title",
                "type": "string",
                "required": true
              },
              {
                "name": "price",
                "selector": ".price_color",
                "type": "number",
                "pattern": "([0-9.]+)",
                "required": true
              },
              {
                "name": "productUrl",
                "selector": "h3 a",
                "source": "attribute",
                "attribute": "href",
                "type": "url",
                "required": true
              }
            ]
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum dataset and Excel rows across all pages.",
            "default": 100
          },
          "includeInvalidRows": {
            "title": "Include rows with warnings",
            "type": "boolean",
            "description": "Keep partially extracted records and expose validation warnings instead of dropping them.",
            "default": true
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Per-page HTTP timeout in seconds.",
            "default": 30
          },
          "sheetName": {
            "title": "Excel sheet name",
            "maxLength": 31,
            "type": "string",
            "description": "Worksheet name, up to 31 characters.",
            "default": "Web data"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}