{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Web Data Extractor (Your Own LLM Key, JSON Schema)",
    "description": "Turn any web page into clean JSON. Give URLs plus a field list or JSON Schema; your own OpenAI, Groq, OpenRouter, Anthropic or OpenAI-compatible key does the reading. Schema-validated output, robots.txt respected. $0.01 per page.",
    "version": "1.0",
    "x-build-id": "99ATgaV5kwFkIrXsb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gigsmith~ai-web-data-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gigsmith-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/gigsmith~ai-web-data-extractor/runs": {
      "post": {
        "operationId": "runs-sync-gigsmith-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/gigsmith~ai-web-data-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-gigsmith-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",
        "required": [
          "startUrls",
          "llmApiKey"
        ],
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Public web pages to extract from. Each URL is fetched once (no crawling). Pages blocked by the site's robots.txt are skipped and not charged.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "fields": {
            "title": "Fields to extract",
            "type": "array",
            "description": "One field per line: `name`, `name: description` or `name (type): description`. Types: string (default), number, integer, boolean, url, string[], number[], url[]. Ignored when a JSON Schema is set.",
            "items": {
              "type": "string"
            }
          },
          "jsonSchema": {
            "title": "JSON Schema (optional)",
            "type": "object",
            "description": "Full control over the output: a JSON Schema with \"type\": \"object\" and properties. When set, it replaces \"Fields to extract\". Every answer is validated against it, and answers that fail are not charged."
          },
          "extractList": {
            "title": "Extract a list of records per page",
            "type": "boolean",
            "description": "Turn on for listing pages (products, jobs, people, events). The output becomes `data.items`, an array where each item matches your fields or schema.",
            "default": false
          },
          "instructions": {
            "title": "Extra instructions (optional)",
            "type": "string",
            "description": "Plain-English hints, e.g. \"Prices are in EUR\" or \"Only include speakers, not organizers\"."
          },
          "llmProvider": {
            "title": "LLM provider",
            "enum": [
              "openai",
              "groq",
              "openrouter",
              "anthropic",
              "custom"
            ],
            "type": "string",
            "description": "Which service your key belongs to. Your provider bills your key directly for tokens; this Actor charges only its per-page fee.",
            "default": "openai"
          },
          "llmApiKey": {
            "title": "LLM API key",
            "type": "string",
            "description": "Your own API key for the provider above. Stored encrypted by Apify and never written to the dataset or log."
          },
          "model": {
            "title": "Model (optional)",
            "type": "string",
            "description": "Leave empty for a fast, low-cost default: gpt-4o-mini (OpenAI), llama-3.3-70b-versatile (Groq), openai/gpt-4o-mini (OpenRouter), claude-haiku-4-5 (Anthropic). Required for a custom provider."
          },
          "llmBaseUrl": {
            "title": "Custom base URL (OpenAI-compatible)",
            "type": "string",
            "description": "Only for \"Other OpenAI-compatible API\", e.g. https://api.together.xyz/v1 or https://api.deepseek.com/v1. The Actor calls {base}/chat/completions."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many URLs.",
            "default": 100
          },
          "maxContentChars": {
            "title": "Max page characters sent to the model",
            "minimum": 2000,
            "maximum": 400000,
            "type": "integer",
            "description": "Longer pages are cut to this length to control your token cost (about 4 characters per token).",
            "default": 40000
          },
          "includeLinks": {
            "title": "Keep link and image URLs in the page text",
            "type": "boolean",
            "description": "Lets the model return URLs (product links, image URLs). Turn off to save tokens if you don't need URLs.",
            "default": true
          },
          "includePageText": {
            "title": "Include the cleaned page text in the output",
            "type": "boolean",
            "description": "Adds `pageText`, the exact text the model saw. Useful for checking answers.",
            "default": false
          },
          "maxOutputTokens": {
            "title": "Max output tokens",
            "minimum": 256,
            "maximum": 32000,
            "type": "integer",
            "description": "Raise it for long lists.",
            "default": 4096
          },
          "requestDelaySecs": {
            "title": "Delay between requests to the same site (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Minimum gap between two requests to one website. A robots.txt Crawl-delay is honoured when it is longer.",
            "default": 1
          },
          "maxConcurrency": {
            "title": "Parallel pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Pages processed at once across different sites. Requests to the same site still wait for the delay above.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}