{
  "openapi": "3.0.1",
  "info": {
    "title": "Dark Web Scraper - Tor .onion Page Extractor",
    "description": "Scrape supplied Tor.onion or HTTPS pages through bundled Tor. Extract readable text, links, keyword hits, content hashes, and diagnostics with redaction enabled by default. MCP-ready.",
    "version": "0.1",
    "x-build-id": "fSRzgKsGXj37NkZ4H"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~dark-web-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-dark-web-scraper",
        "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/khadinakbar~dark-web-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-dark-web-scraper",
        "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/khadinakbar~dark-web-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-dark-web-scraper",
        "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": "Start URLs",
            "type": "array",
            "description": "Use this when you already know the pages to inspect. Accepts http or https URLs such as http://exampleonionaddress.onion/ or https://check.torproject.org/. Defaults to a Tor check page. This is not a keyword search or hidden-service discovery input.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "routingMode": {
            "title": "Routing mode",
            "enum": [
              "tor",
              "auto",
              "direct"
            ],
            "type": "string",
            "description": "Use this to choose how requests leave the actor. auto sends .onion URLs through Tor and clearnet URLs directly; tor sends all URLs through Tor; direct sends only clearnet URLs directly. Defaults to tor for a privacy-preserving health check. This is not a proxy bypass tool for login-only sites.",
            "default": "tor"
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Use this to cap the total number of pages fetched across all seeds. Accepts 1 to 100; default is 3 and prefill is 3. The actor stops before this cap and will not charge beyond successful pages. This is not a search-results limit.",
            "default": 3
          },
          "maxDepth": {
            "title": "Max crawl depth",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Use this to control link following from each seed page. Accepts 0 to 3; depth 0 fetches only the supplied URLs. Defaults to 1. This does not discover links from external search engines or onion directories.",
            "default": 1
          },
          "crawlExternalHosts": {
            "title": "Crawl external hosts",
            "type": "boolean",
            "description": "Use this only when you want links to other hosts added to the crawl queue. Defaults to false so the actor stays inside the supplied host scope. The output still reports external links. This is not a broad dark-web discovery mode.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Use this to tune how many pages are fetched at once. Accepts 1 to 5; default is 2 because Tor hidden services are often slow. Higher values may time out more often. This is not a retry count.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Use this to cap each page fetch. Accepts 10 to 120 seconds; default is 45. Onion services can be slow, so short timeouts may produce diagnostic rows. This is not the total actor timeout.",
            "default": 45
          },
          "torBootstrapTimeoutSecs": {
            "title": "Tor bootstrap timeout",
            "minimum": 20,
            "maximum": 180,
            "type": "integer",
            "description": "Use this to cap how long the bundled Tor daemon may take to become ready. Accepts 20 to 180 seconds; default is 75. Raise it if Tor circuits are slow in the cloud. This is ignored when routingMode is direct.",
            "default": 75
          },
          "torProxyUrl": {
            "title": "External Tor SOCKS proxy",
            "type": "string",
            "description": "Use this when you want to supply an existing Tor SOCKS endpoint instead of starting the bundled Tor daemon. Accepts a URL like socks5h://127.0.0.1:9050. Defaults to empty, which starts bundled Tor when needed. This is not an HTTP proxy URL."
          },
          "keywordMatches": {
            "title": "Keyword matches",
            "type": "array",
            "description": "Use this to count exact keyword or phrase matches in each page. Accepts one keyword per line, such as your brand, domain, or product name. Defaults to an empty list. This does not search the dark web for new pages.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "responseFormat": {
            "title": "Response format",
            "enum": [
              "concise",
              "detailed"
            ],
            "type": "string",
            "description": "Use this to control how much page content appears in each dataset item. concise returns a preview only; detailed includes longer text and simple Markdown. Defaults to concise for MCP clients. This does not affect link or diagnostic fields.",
            "default": "concise"
          },
          "maxContentChars": {
            "title": "Max content characters",
            "minimum": 500,
            "maximum": 50000,
            "type": "integer",
            "description": "Use this to limit returned text size per page. Accepts 500 to 50000 characters; default is 8000. Longer content is truncated with a note. This does not increase the page fetch size cap.",
            "default": 8000
          },
          "maxLinksPerPage": {
            "title": "Max links per page",
            "minimum": 0,
            "maximum": 250,
            "type": "integer",
            "description": "Use this to limit how many extracted links are stored per page. Accepts 0 to 250; default is 75. Link counts still reflect all discovered links. This is not the number of links crawled.",
            "default": 75
          },
          "redactSensitive": {
            "title": "Redact sensitive patterns",
            "type": "boolean",
            "description": "Use this to mask email-like, phone-like, crypto-wallet-like, and API-key-like strings before content is saved. Defaults to true for safer research workflows. Turn off only for lawful authorized investigations. This does not delete the source page.",
            "default": true
          },
          "saveHtmlToKeyValueStore": {
            "title": "Save raw HTML to KV store",
            "type": "boolean",
            "description": "Use this when you need page snapshots for audit or reproducibility. Defaults to false because raw HTML can contain sensitive material. When true, HTML is saved under HTML_ keys and referenced from dataset rows. This does not redact the raw HTML.",
            "default": false
          },
          "userAgent": {
            "title": "User agent",
            "type": "string",
            "description": "Use this to override the HTTP User-Agent header. Accepts a normal browser user agent string. Defaults to a current desktop browser-like value. This is not a browser fingerprint or JavaScript execution setting."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}