{
  "openapi": "3.0.1",
  "info": {
    "title": "Wayback Machine Scraper",
    "description": "Every archived capture of any URL, from the Internet Archive. List snapshots for one page, a path prefix or a whole domain, filter by status code, MIME type and date, and pull back the archived HTML exactly as it was originally served.",
    "version": "0.1",
    "x-build-id": "VBuRNSxbp9rjc5ZHN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/spookyweb~wayback-machine-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-spookyweb-wayback-machine-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/spookyweb~wayback-machine-scraper/runs": {
      "post": {
        "operationId": "runs-sync-spookyweb-wayback-machine-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/spookyweb~wayback-machine-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-spookyweb-wayback-machine-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",
        "properties": {
          "url": {
            "title": "URL",
            "type": "string",
            "description": "The page or site to look up in the Internet Archive. The protocol is optional and is ignored, so bbc.co.uk and https://bbc.co.uk are the same query."
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Look up several pages or sites in one run, up to 50. Takes priority over the single URL field when both are given, and each URL is charged separately.",
            "items": {
              "type": "string"
            }
          },
          "useCase": {
            "title": "Preset",
            "enum": [
              "",
              "seo",
              "compliance",
              "competitor",
              "forensics"
            ],
            "type": "string",
            "description": "Applies the options that suit a job so you do not have to work them out. seo crawls a path prefix monthly, compliance keeps only captures whose content changed and fetches them, competitor watches a page for changes and returns only those, forensics returns every capture across a whole domain. Anything you set explicitly wins over the preset.",
            "default": ""
          },
          "matchType": {
            "title": "What to match",
            "enum": [
              "exact",
              "prefix",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "exact returns captures of that one URL. prefix returns everything under that path. host returns every page on that exact hostname. domain also includes subdomains such as news.bbc.co.uk.",
            "default": "exact"
          },
          "from": {
            "title": "Earliest capture",
            "type": "string",
            "description": "Only return captures on or after this date. Accepts a year, a year and month, or a full date: 2024, 202403 or 20240315."
          },
          "to": {
            "title": "Latest capture",
            "type": "string",
            "description": "Only return captures on or before this date. Same formats as the earliest capture: 2024, 202403 or 20240315."
          },
          "targetDate": {
            "title": "Closest to this date",
            "type": "string",
            "description": "Return only the single capture nearest this date, with the gap reported in days. This is the one to use for evidence of what a page said on a particular day, such as the date a contract was signed."
          },
          "snapshotsPer": {
            "title": "How many captures to keep",
            "enum": [
              "none",
              "daily",
              "monthly",
              "yearly",
              "changesOnly"
            ],
            "type": "string",
            "description": "A busy homepage holds tens of thousands of near identical captures. Keeping one per day, month or year gives a usable history instead. Content changes only keeps a capture when the archive's own content fingerprint differs from the one before it, which is the cheapest way to find the moments a page actually moved.",
            "default": "none"
          },
          "maxSnapshots": {
            "title": "Maximum snapshots per URL",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many captures for each URL. Every snapshot returned is charged, so this is the ceiling on what a run can cost.",
            "default": 100
          },
          "statusCodes": {
            "title": "HTTP status codes",
            "type": "array",
            "description": "Only return captures served with these status codes. Use 200 to exclude redirects and error pages, which is usually what you want.",
            "items": {
              "type": "string"
            }
          },
          "mimeTypes": {
            "title": "MIME types",
            "type": "array",
            "description": "Only return captures of these content types, for example text/html to exclude images, scripts and stylesheets.",
            "items": {
              "type": "string"
            }
          },
          "detectChanges": {
            "title": "Detect changes between captures",
            "type": "boolean",
            "description": "Compare each capture with the one before it and label what moved. Uses the archive's own content fingerprint, so whether a page changed costs nothing extra. What changed needs the content, so turn on retrieving it as well for a full diff.",
            "default": false
          },
          "onlyChanged": {
            "title": "Return only captures that changed",
            "type": "boolean",
            "description": "Drop captures identical to the one before them, so a decade of history collapses to the handful of dates the page actually moved. Needs change detection switched on.",
            "default": false
          },
          "fetchContent": {
            "title": "Retrieve the archived page",
            "type": "boolean",
            "description": "Download each capture as well as indexing it. Charged at the higher rate, and it is what enables the full diff including title and price changes.",
            "default": false
          },
          "includeRawHtml": {
            "title": "Include the raw HTML",
            "type": "boolean",
            "description": "Return the page exactly as the server originally sent it, with no archive toolbar and no rewritten links. This is the original bytes rather than a cleaned copy, so it can be parsed as if you had fetched the page at the time.",
            "default": true
          },
          "includeText": {
            "title": "Include extracted text",
            "type": "boolean",
            "description": "Return the readable text of the page alongside the HTML, with scripts, styles and the archive's own toolbar removed. Useful for reading and for feeding to a model.",
            "default": true
          },
          "maxTextChars": {
            "title": "Truncate text at",
            "minimum": 0,
            "type": "integer",
            "description": "Cut the extracted text at this many characters. Leave at 0 to keep the whole page, which is the default because truncation loses the end of long documents silently.",
            "default": 0
          },
          "maxContentFetches": {
            "title": "Maximum pages to download",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on how many captures have their content retrieved across the whole run. Captures beyond this are still indexed, just without content.",
            "default": 25
          },
          "jsRender": {
            "title": "Render JavaScript",
            "enum": [
              "off",
              "auto",
              "always"
            ],
            "type": "string",
            "description": "Some captures are an empty shell because the page built itself in the browser. Rendering recovers that text, and it runs the archived JavaScript from the same capture rather than today's code, so the result is period correct. Auto renders only captures that look like shells, which is the setting to use. Always renders every retrieved capture and is much slower.",
            "default": "off"
          },
          "generateReport": {
            "title": "Write a markdown report",
            "type": "boolean",
            "description": "Save a readable summary to the key value store as REPORT.md, listing the changes ranked by how big they were, with pricing and title moves called out and an archive link on every row so a reader can check the claim. Use this when the output is for a person or a model rather than a pipeline.",
            "default": false
          },
          "monitor": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "Remember the newest capture seen for each URL and return only what has appeared since the previous run. Turn this on for a scheduled run so it reports new activity rather than the whole history every time.",
            "default": false
          },
          "timeoutSecs": {
            "title": "Request timeout, seconds",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for the archive before giving up on a single request. Large archived pages can be slow to serve.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}