{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Data Extraction: Any Web Page to JSON Schema",
    "description": "Extract structured data from a list of URLs with an LLM. Give a JSON Schema or a list of fields and get one JSON record per page, validated against the schema and retried once on failure. Uses your Anthropic, OpenAI or OpenRouter key, with a key-free demo. About $0.01 per page plus your LLM cost.",
    "version": "0.1",
    "x-build-id": "DugyUjLT0qYUsgCqE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fernandosord~ai-structured-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fernandosord-ai-structured-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/fernandosord~ai-structured-extractor/runs": {
      "post": {
        "operationId": "runs-sync-fernandosord-ai-structured-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/fernandosord~ai-structured-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-fernandosord-ai-structured-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"
        ],
        "properties": {
          "startUrls": {
            "title": "URLs",
            "type": "array",
            "description": "Public web pages to extract from. Each URL becomes one row in the dataset. Duplicates are removed.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "fields": {
            "title": "Fields (plain language)",
            "type": "array",
            "description": "One field per line, optionally followed by a colon and a description, e.g. `price: listed price including currency`. Ignored when a JSON Schema is given.",
            "items": {
              "type": "string"
            }
          },
          "pageType": {
            "title": "Page type (for plain-language fields)",
            "enum": [
              "single",
              "list"
            ],
            "type": "string",
            "description": "`single`: one object per page, e.g. a product page. `list`: an array with one object per item, e.g. a search result or category page. With a JSON Schema, use a root of type `array` instead.",
            "default": "single"
          },
          "jsonSchema": {
            "title": "JSON Schema",
            "type": "object",
            "description": "A JSON Schema for the result of each page. When set, it is used instead of the plain-language fields. Results that do not validate are retried once and then saved with status `validation_failed`."
          },
          "instructions": {
            "title": "Extra instructions",
            "type": "string",
            "description": "Optional notes for the model, e.g. `Prices are in EUR; return numbers without the currency sign.`"
          },
          "llmProvider": {
            "title": "LLM provider",
            "enum": [
              "anthropic",
              "openai",
              "openrouter"
            ],
            "type": "string",
            "description": "Which API your key belongs to.",
            "default": "anthropic"
          },
          "llmApiKey": {
            "title": "LLM API key",
            "type": "string",
            "description": "Your API key for the chosen provider. Stored encrypted by Apify and never logged or written to the dataset. Leave empty to run the key-free demo."
          },
          "llmModel": {
            "title": "Model",
            "type": "string",
            "description": "Model ID. Leave empty for the default: `claude-haiku-5-5` (Anthropic), `gpt-5.4-mini` (OpenAI), `anthropic/claude-haiku-5.5` (OpenRouter)."
          },
          "maxContentChars": {
            "title": "Max page characters sent to the LLM",
            "minimum": 1000,
            "maximum": 400000,
            "type": "integer",
            "description": "The page is converted to markdown first. Longer pages are cut at this length and the row is marked `truncated: true`. Lower it to cut LLM cost.",
            "default": 60000
          },
          "contentCssSelector": {
            "title": "Content CSS selector",
            "type": "string",
            "description": "Optional. Only send the matching part of the page to the LLM, e.g. `main` or `#product`. Falls back to the whole body if nothing matches."
          },
          "removeCssSelector": {
            "title": "Remove CSS selector",
            "type": "string",
            "description": "Optional. Elements to drop before extraction, e.g. `nav, footer, .cookie-banner`."
          },
          "useBrowserFallback": {
            "title": "Render JavaScript pages in a browser when needed",
            "type": "boolean",
            "description": "Pages are fetched with plain HTTP first. If the response is an empty JavaScript shell, the page is loaded once more in headless Chromium.",
            "default": true
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many URLs.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages are processed at the same time. Lower it if your LLM account hits rate limits.",
            "default": 5
          },
          "extraBlockedDomains": {
            "title": "Extra domains to skip",
            "type": "array",
            "description": "Hostnames to skip in addition to the built-in list (subdomains included), e.g. `example.org`.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}