{
  "openapi": "3.0.1",
  "info": {
    "title": "Wayback Machine Toolkit — Archived URLs, Snapshots & Diffs",
    "description": "Three Internet Archive tools in one Actor: list every archived capture of a URL, path or whole domain from the CDX index; read an archived page as text or Markdown at any date; and diff one page between two dates for added and removed lines, headings and prices.",
    "version": "0.1",
    "x-build-id": "v7YbiEaxPfMjWFjfh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insight.solutions~wayback-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insight.solutions-wayback-toolkit",
        "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/insight.solutions~wayback-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-insight.solutions-wayback-toolkit",
        "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/insight.solutions~wayback-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-insight.solutions-wayback-toolkit",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "cdx",
              "snapshot",
              "diff"
            ],
            "type": "string",
            "description": "What to return. cdx = the archive index: one row per archived capture, with timestamp, HTTP status, MIME type, digest and size. snapshot = the archived content itself at the dates you choose, as text, Markdown or the original HTML. diff = what changed on one URL between two dates: added and removed lines, a similarity ratio, and the headings and prices that moved.",
            "default": "cdx"
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "URLs or domains to look up, e.g. example.com/pricing or example.com. The scheme is optional. The Wayback Machine indexes http:// and https:// captures of the same page under one key, so you do not need both. A single URL may also be passed as a plain string in a \"url\" field instead of this list.",
            "items": {
              "type": "string"
            }
          },
          "matchType": {
            "title": "Match type",
            "enum": [
              "exact",
              "prefix",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "How broadly to match the URL in the index. exact = only this page. prefix = this page and everything under its path. host = every page on this exact hostname. domain = every page on this hostname and its subdomains. Used by cdx mode; snapshot and diff modes always match exactly, because they compare one page against itself.",
            "default": "exact"
          },
          "from": {
            "title": "From date",
            "type": "string",
            "description": "Only consider captures made on or after this date. Accepts YYYYMMDD, an ISO date, or a partial date such as 2019 or 201907."
          },
          "to": {
            "title": "To date",
            "type": "string",
            "description": "Only consider captures made on or before this date. Accepts YYYYMMDD, an ISO date, or a partial date such as 2019 or 201907."
          },
          "statusFilter": {
            "title": "HTTP status codes",
            "type": "array",
            "description": "Only return captures whose archived HTTP status is in this list. The default of 200 excludes archived redirects and error pages, which are indexed too and are almost never what you want. Leave empty to return every capture whatever its status.",
            "default": [
              "200"
            ],
            "items": {
              "type": "string"
            }
          },
          "mimeFilter": {
            "title": "MIME types",
            "type": "array",
            "description": "Only return captures whose archived Content-Type is in this list. The default of text/html excludes images, stylesheets and PDFs. Leave empty to return every capture whatever its type.",
            "default": [
              "text/html"
            ],
            "items": {
              "type": "string"
            }
          },
          "collapse": {
            "title": "Collapse duplicates",
            "enum": [
              "digest",
              "timestamp:8",
              "timestamp:6",
              "urlkey",
              "none"
            ],
            "type": "string",
            "description": "Which adjacent duplicate captures the index should drop. digest = drop captures whose content is byte-identical to the one before, so you get one row per actual change (this is the useful default, and it means you are not billed for a page that sat unchanged for a year). timestamp:6 = at most one capture per month. timestamp:8 = at most one per day. none = every capture. Used by cdx mode only.",
            "default": "digest"
          },
          "limit": {
            "title": "Max captures per URL",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum index rows returned per URL in cdx mode. This is a hard cap applied by the archive itself, so a domain-wide query cannot run away. A prefix or domain match on a large site can have millions of captures — start small.",
            "default": 200
          },
          "dates": {
            "title": "Dates",
            "type": "array",
            "description": "Which captures to work with. Each entry is either \"earliest\", \"latest\", or a date such as 20240115, in which case the nearest capture to that date is used. In snapshot mode you may list as many as you like; leave it empty for the latest capture. In diff mode you must list exactly two; leave it empty to compare the earliest capture with the latest. The older capture is always treated as the \"before\" side, whichever order you write the two in.",
            "items": {
              "type": "string"
            }
          },
          "snapshotFormat": {
            "title": "Snapshot format",
            "enum": [
              "text",
              "markdown",
              "html"
            ],
            "type": "string",
            "description": "How to return archived page content in snapshot mode. text = visible text, one line per block element. markdown = headings, lists and links preserved as Markdown. html = the archived HTML exactly as the Internet Archive stored it, with no Wayback toolbar injected.",
            "default": "text"
          },
          "diffGranularity": {
            "title": "Diff granularity",
            "enum": [
              "line",
              "word"
            ],
            "type": "string",
            "description": "How much word-level detail a diff row carries. line = added and removed lines, with a short word-level sample for the summary. word = the full list of word runs that were added and removed as well. Both settings return the same line counts, similarity ratio, heading changes and price changes.",
            "default": "line"
          },
          "maxSnapshotKb": {
            "title": "Max snapshot size (KB)",
            "minimum": 16,
            "maximum": 8192,
            "type": "integer",
            "description": "How much of each archived document to read. Anything beyond this is discarded and the row is flagged with truncated: true. Archived pages can be enormous; this keeps a single capture from exhausting the run's memory.",
            "default": 2048
          },
          "maxRunSecs": {
            "title": "Maximum run time (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Wall-clock budget for the whole run. When it is reached the Actor stops requesting more data, keeps every row it has already written, and says so in the run status. Rows already written are still charged; nothing is charged for work that did not happen. archive.org is slow at times, so raise this before splitting a large job.",
            "default": 240
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}