{
  "openapi": "3.0.1",
  "info": {
    "title": "Webpage to JSON for AI Agents (MCP)",
    "description": "Turn any web page into clean, typed JSON with AI. Describe what you want in plain English or a JSON schema; every value comes with a source quote. LLM included, no API key. Pay only for pages with data.",
    "version": "0.0",
    "x-build-id": "gfhQU84tILsRBqVTe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s3nafps~webpage-to-json-for-ai-agents/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s3nafps-webpage-to-json-for-ai-agents",
        "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/s3nafps~webpage-to-json-for-ai-agents/runs": {
      "post": {
        "operationId": "runs-sync-s3nafps-webpage-to-json-for-ai-agents",
        "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/s3nafps~webpage-to-json-for-ai-agents/run-sync": {
      "post": {
        "operationId": "run-sync-s3nafps-webpage-to-json-for-ai-agents",
        "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": {
          "urls": {
            "title": "Page URLs",
            "type": "array",
            "description": "Public web pages to extract data from, one URL per line. Each URL is one page (no crawling). Leave empty if you use a dataset as the source.",
            "items": {
              "type": "string"
            }
          },
          "instruction": {
            "title": "What to extract (plain English)",
            "type": "string",
            "description": "Describe the data you want, e.g. \"the product name, price as a number, currency and whether it is in stock\". Use this alone, or together with Fields or a JSON schema to add context."
          },
          "fields": {
            "title": "Fields (simple)",
            "type": "array",
            "description": "Optional. One field per line in the form `name (type): description`. Types: string, number, integer, boolean, array. Example: `price (number): current price without currency symbol`. Ignored if a JSON schema is given.",
            "items": {
              "type": "string"
            }
          },
          "extractionSchema": {
            "title": "JSON schema (advanced)",
            "type": "object",
            "description": "Optional. A JSON Schema object describing ONE record. Output is validated against it. Takes priority over Fields."
          },
          "listMode": {
            "title": "Extract a list of records per page",
            "type": "boolean",
            "description": "Turn on for listing pages (products, jobs, events, team members...). Each page then returns an array of records instead of one.",
            "default": false
          },
          "maxRecordsPerPage": {
            "title": "Max records per page (list mode)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper limit of records returned per page in list mode.",
            "default": 50
          },
          "requireEvidence": {
            "title": "Require evidence for every value",
            "type": "boolean",
            "description": "When on, any value whose source quote cannot be found on the page is set to null instead of being returned. Recommended for agents and anything you will trust without checking.",
            "default": true
          },
          "datasetId": {
            "title": "Source dataset ID",
            "type": "string",
            "description": "Optional. Extract from an existing Apify dataset instead of fetching URLs, e.g. the output of AI-Ready Webpage Extractor. Saves a re-fetch and works for JavaScript-heavy pages that were already rendered."
          },
          "datasetTextField": {
            "title": "Dataset text field",
            "type": "string",
            "description": "Field holding the page content in the source dataset. Leave empty to auto-detect (markdown, text, content)."
          },
          "datasetUrlField": {
            "title": "Dataset URL field",
            "type": "string",
            "description": "Field holding the page URL in the source dataset.",
            "default": "url"
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of pages (URLs or dataset items) to process in this run.",
            "default": 100
          },
          "maxContentChars": {
            "title": "Max page characters sent to the AI",
            "minimum": 2000,
            "maximum": 120000,
            "type": "integer",
            "description": "Longer pages are trimmed to this length before extraction. Raise it for very long pages.",
            "default": 30000
          },
          "includePageText": {
            "title": "Include cleaned page text in output",
            "type": "boolean",
            "description": "Adds the cleaned Markdown that was sent to the AI. Useful for debugging; makes output larger.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages to process in parallel.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Use a proxy if target sites block direct requests.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}