{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Web Data Extractor – Any URL or PDF to JSON, No API Key",
    "description": "Turn any web page, PDF or DOCX into structured JSON with an LLM. Describe the fields in plain English or a JSON schema; output is validated. No OpenAI/OpenRouter key: tokens are billed to your Apify account via Apify's OpenRouter Actor. $4 per 1,000 pages.",
    "version": "0.1",
    "x-build-id": "nPhNjAWXNJfKme89f"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~ai-web-data-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-ai-web-data-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/gazidev~ai-web-data-extractor/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-ai-web-data-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/gazidev~ai-web-data-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-ai-web-data-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",
        "properties": {
          "startUrls": {
            "title": "URLs",
            "type": "array",
            "description": "Web pages, PDFs or DOCX files to extract data from (one row per page). Social-media sites (Facebook, Instagram, LinkedIn, X, TikTok, Reddit, YouTube...) are not supported.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "datasetId": {
            "title": "…or read URLs from an Apify dataset",
            "type": "string",
            "description": "Optional: chain this Actor after a crawler, sitemap or search Actor. In an integration use {{resource.defaultDatasetId}}."
          },
          "datasetField": {
            "title": "Dataset field with the URL",
            "type": "string",
            "description": "Field name in that dataset (arrays of URLs are also accepted).",
            "default": "url"
          },
          "instruction": {
            "title": "Extraction instruction (plain English)",
            "type": "string",
            "description": "Tell the model what to extract, e.g. 'Extract company name, contact email and phone' or 'List every job opening with title, location and salary'. Used alone, the model picks the keys; combine with Fields or a JSON schema for a fixed structure."
          },
          "fields": {
            "title": "Fields to extract",
            "type": "array",
            "description": "One field per line: `name`, `name: description` or `name (type): description`. Types: string, number, integer, boolean, date, url, string[] (list). Ignored when a JSON schema is given.",
            "items": {
              "type": "string"
            }
          },
          "jsonSchema": {
            "title": "JSON schema (optional, overrides Fields)",
            "type": "object",
            "description": "A JSON Schema for one record, e.g. {\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"price\":{\"type\":\"number\"}}}. The shorthand {\"name\":\"string\",\"price\":\"number\"} also works. Output is validated against it; any value may be null when it is not on the page."
          },
          "multipleItemsPerPage": {
            "title": "Many records per page (listings)",
            "type": "boolean",
            "description": "For search results, category pages, job boards, tables: return every record on the page as an array in `data` (one dataset row per page, charged once).",
            "default": false
          },
          "model": {
            "title": "LLM model",
            "enum": [
              "google/gemini-2.5-flash-lite",
              "google/gemini-2.5-flash",
              "openai/gpt-4.1-mini",
              "openai/gpt-5-mini",
              "anthropic/claude-haiku-4.5",
              "deepseek/deepseek-chat-v3.1"
            ],
            "type": "string",
            "description": "Called through Apify's OpenRouter Actor; token cost is billed to your Apify account at OpenRouter prices (10x on the Apify free plan). See README for per-page estimates.",
            "default": "google/gemini-2.5-flash-lite"
          },
          "customModel": {
            "title": "Custom OpenRouter model ID",
            "type": "string",
            "description": "Optional: any model ID from openrouter.ai/models, e.g. `mistralai/mistral-small-3.2-24b-instruct`. Overrides the select above."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after fetching this many pages. You pay only for pages extracted successfully.",
            "default": 10
          },
          "followLinks": {
            "title": "Follow links on the same domain",
            "type": "boolean",
            "description": "Also extract pages linked from the start URLs (same website only), up to Max pages.",
            "default": false
          },
          "maxDepth": {
            "title": "Link depth",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "With Follow links: 1 = pages linked from the start URLs, 2 = one level further.",
            "default": 1
          },
          "linkFilter": {
            "title": "Only follow links matching (regex)",
            "type": "string",
            "description": "E.g. `/product/` or `/jobs/\\d+`. Empty = all same-domain links."
          },
          "maxContentChars": {
            "title": "Max characters sent to the LLM per page",
            "minimum": 2000,
            "maximum": 400000,
            "type": "integer",
            "description": "Longer pages are cut (about 4 characters = 1 token). Lower = cheaper LLM cost.",
            "default": 40000
          },
          "maxPdfPages": {
            "title": "Max PDF pages read",
            "minimum": 1,
            "type": "integer",
            "description": "Only the first N pages of each PDF are read (text PDFs; scanned PDFs without a text layer are not OCR'd).",
            "default": 30
          },
          "contentMode": {
            "title": "Page content",
            "enum": [
              "main",
              "full"
            ],
            "type": "string",
            "description": "Use Full page if the data you need is in a header, footer or sidebar (e.g. contact details).",
            "default": "main"
          },
          "includeContent": {
            "title": "Include page text in output",
            "type": "boolean",
            "description": "Adds the cleaned Markdown/text that was sent to the model (useful for auditing).",
            "default": false
          },
          "respectRobots": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Skip pages disallowed by the site's robots.txt (recommended).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Pages processed in parallel.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for each page or document to download before it is skipped (not charged).",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Not needed for most sites.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}