{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Web Scraper: Extract Structured Data from Any Website",
    "description": "AI web scraper that turns any web page into clean JSON. Describe the fields in plain English (\"product name, price, in stock\") or paste a JSON schema; an LLM (Claude or GPT, your own API key) extracts them from each page. Works on product lists, job posts, articles and business pages.",
    "version": "1.0",
    "x-build-id": "vKQaXFLRcgzacLhmx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dailypalslab~ai-web-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dailypalslab-ai-web-extractor",
        "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/dailypalslab~ai-web-extractor/runs": {
      "post": {
        "operationId": "runs-sync-dailypalslab-ai-web-extractor",
        "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/dailypalslab~ai-web-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-dailypalslab-ai-web-extractor",
        "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": "Page URLs",
            "type": "array",
            "description": "Web pages to extract data from, one per line (product lists, product pages, job posts, articles, company pages...). Pages must load without a login. JavaScript-only pages are not rendered in this version.",
            "default": [
              "https://books.toscrape.com/"
            ],
            "items": {
              "type": "string"
            }
          },
          "extractionPrompt": {
            "title": "What to extract (plain English)",
            "type": "string",
            "description": "Describe the fields you want, e.g. \"For every product: name, price, currency, in stock, rating, product URL\" or \"company name, phone, opening hours, address\". If you don't give a JSON schema, one is built from this description (shown in the run's SUMMARY so you can reuse it). Use words like \"every\" or \"all\" to get a list of items per page."
          },
          "jsonSchema": {
            "title": "JSON schema (optional)",
            "type": "object",
            "description": "Exact fields to return, as a JSON schema ({\"type\":\"object\",\"properties\":{\"price\":{\"type\":\"number\"}}}), an array schema for lists, or a shorthand like {\"name\":\"string\",\"price\":\"number\",\"tags\":[\"string\"]}. Overrides the schema built from the description; the description is still passed to the model as extra instructions."
          },
          "listMode": {
            "title": "Records per page",
            "enum": [
              "auto",
              "single",
              "list"
            ],
            "type": "string",
            "description": "Single: one record per page (a product page, a job post). List: every matching item on the page (all products in a category, all jobs on a careers page). Auto: decided from your schema or description.",
            "default": "auto"
          },
          "crawlSameSite": {
            "title": "Follow links on the same website",
            "type": "boolean",
            "description": "Also extract from pages linked from your URLs on the same website (breadth-first, respects robots.txt and its crawl delay), up to the maximum number of pages.",
            "default": false
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of pages to process in this run, including your URLs (1-500). Each successful page is one charged event.",
            "default": 10
          },
          "maxCharsPerPage": {
            "title": "Max characters per page",
            "minimum": 2000,
            "maximum": 200000,
            "type": "integer",
            "description": "Page Markdown is cut to this many characters before it is sent to the model (about 4 characters per token, so 40,000 ≈ 10,000 input tokens). Lower it to save on your LLM bill; raise it for very long pages.",
            "default": 40000
          },
          "provider": {
            "title": "AI provider",
            "enum": [
              "auto",
              "anthropic",
              "openai",
              "demo"
            ],
            "type": "string",
            "description": "Which LLM extracts the data, using your own API key. Auto: detected from the key (sk-ant-... = Anthropic, sk-... = OpenAI); with no key it runs the free Demo. Demo: no AI, returns the cleaned page Markdown and a suggested schema, nothing charged.",
            "default": "auto"
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your Anthropic (console.anthropic.com) or OpenAI (platform.openai.com) API key. Leave empty to run the free Demo."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Model name. Leave empty for the fast, low-cost default: claude-haiku-5-5 (Anthropic) or gpt-5.4-mini (OpenAI). Any model your key can use works, e.g. claude-sonnet-5-5 or gpt-5.5 for harder pages."
          },
          "maxConcurrency": {
            "title": "Parallel pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many pages are fetched and sent to the model at the same time. Lower it if your provider rate-limits you; rate-limit errors are retried with backoff.",
            "default": 3
          },
          "includeMarkdown": {
            "title": "Include page Markdown in results",
            "type": "boolean",
            "description": "Add the cleaned Markdown that was sent to the model to each row (handy for checking results or for RAG). Always on in Demo mode.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}