{
  "openapi": "3.0.1",
  "info": {
    "title": "Wayback Machine Snapshots: Archived URL History & Dead Links",
    "description": "Every archived capture of a URL from the Internet Archive Wayback Machine: capture time in UTC, HTTP status, MIME type, size, content digest, replay link and raw-file link. Also finds the copy closest to a date and lists the archived URLs of a whole site.",
    "version": "0.1",
    "x-build-id": "N8pB3EXmuM5MNZCk6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~wayback-machine-snapshots/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-wayback-machine-snapshots",
        "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/yadroo~wayback-machine-snapshots/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-wayback-machine-snapshots",
        "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/yadroo~wayback-machine-snapshots/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-wayback-machine-snapshots",
        "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": [
          "urls"
        ],
        "properties": {
          "mode": {
            "title": "What to look up",
            "enum": [
              "captures",
              "closest",
              "siteUrls"
            ],
            "type": "string",
            "description": "Three different questions, one per run. `captures` answers \"when was this page archived and did it change\" - one row per stored capture. `closest` answers \"give me one working archived copy near this date\", which is what repairing a dead link or a footnote needs: one row per URL, including a row marked `found: false` for URLs the archive never stored. `siteUrls` answers \"which addresses under this site are in the archive at all\" - one row per archived URL.",
            "default": "captures"
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "The addresses to look up, at most 100 per run. Write them as people write them: `https://example.com/page`, `example.com/page` and `http://example.com/page` are all accepted, because the archive indexes a canonical form of the address and the scheme rarely matters. A trailing slash does matter for `siteUrls` with `prefix` scope - `https://www.irs.gov/pub/irs-pdf/` means everything under that folder. More than 100 URLs is refused with a clear message instead of a half-finished run.",
            "items": {
              "type": "string"
            }
          },
          "targetDate": {
            "title": "Date to aim at",
            "type": "string",
            "description": "Used by `closest`. The moment you want a copy from: `2016`, `2016-03`, `2016-03-01` or a full `2016-03-01T12:00:00Z` are all read. Leave it empty to get the newest capture the archive holds. The answer is the nearest capture in either direction, and `offsetDays` says how far it landed from your date - a page archived twice in ten years can answer a 2016 question with a 2011 capture, so always read that column before quoting the copy."
          },
          "matchScope": {
            "title": "How wide to search the site",
            "enum": [
              "prefix",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "Used by `siteUrls`. `prefix` keeps the path you typed and walks down from it, `host` ignores the path and returns the whole host, `domain` adds every subdomain, which is how you find the forgotten `old.` and `files.` hosts of an organisation. A big site holds millions of archived addresses, so a wide scope needs `maxItemsPerUrl` and the MIME or status filters to stay useful.",
            "default": "prefix"
          },
          "fromDate": {
            "title": "Captures from",
            "type": "string",
            "description": "Earliest capture to return, as `2024`, `2024-01` or `2024-01-01` (UTC). The Wayback Machine's first captures are from 1996, so leaving this empty really does mean three decades of history for an old site."
          },
          "toDate": {
            "title": "Captures up to",
            "type": "string",
            "description": "Latest capture to return, same forms as above. A date alone covers the whole day. Leave both dates empty for the full history."
          },
          "sinceHours": {
            "title": "Only captures of the last N hours",
            "minimum": 1,
            "maximum": 8760,
            "type": "number",
            "description": "A moving window for watching a page: `24` for the last day, `168` for the last week. It replaces `Captures from` while it is set, so a scheduled run always asks for the fresh part of the history instead of re-reading everything. Nothing in the window is a normal answer and ends the run with a status that says so - the archive crawls a small site a few times a year, not daily."
          },
          "onlyNew": {
            "title": "Skip captures written by earlier runs",
            "type": "boolean",
            "description": "Remember which captures this run wrote in the actor's key-value store and write only unseen ones next time, keyed by URL and capture timestamp. Made for a schedule: with `sinceHours` it turns the actor into a watcher that reports what the archive stored since the last run. The memory belongs to the actor or task that runs, so two tasks watching two sites never shadow each other.",
            "default": false
          },
          "statusCodes": {
            "title": "Keep these HTTP status codes",
            "type": "array",
            "description": "Status of the page at the moment it was archived: `200` for the ones that really hold content, `301` or `302` for redirects, `404` for pages that were already gone when the crawler came. Several values are combined with OR; leave the list empty to keep every capture. The archive stores a dash instead of a status for deduplicated revisit records, so add `-` when you want those too - they appear as an empty `statusCode` column.",
            "items": {
              "type": "string"
            }
          },
          "mimeTypes": {
            "title": "Keep these content types",
            "type": "array",
            "description": "Filter by what was archived: `text/html` for pages, `application/pdf` for documents, `image/jpeg`, `audio/mpeg`, `video/mp4`. A family prefix also works - `audio/` keeps every audio type - which is how you pull a set of lost recordings or every PDF a site once published. Empty means every type.",
            "items": {
              "type": "string"
            }
          },
          "collapseBy": {
            "title": "Thin out the history",
            "enum": [
              "none",
              "hour",
              "day",
              "month",
              "year",
              "digest"
            ],
            "type": "string",
            "description": "A busy news front page is archived dozens of times a day, so the default keeps one capture per day and a year of history fits in 365 rows instead of thousands. `month` or `year` gives a quick long-range picture, `none` the complete record, `digest` drops a capture whose content hash equals the previous one. Thinning happens inside the archive's index before the row cap is applied, so it changes which captures you see, not how many rows you pay for.",
            "default": "day"
          },
          "changedOnly": {
            "title": "Only captures where the content changed",
            "type": "boolean",
            "description": "Compare the content hash of each capture with the previous capture of the same URL and keep only the ones that differ, so a page archived 400 times with 12 real edits gives 12 rows. The first capture of a URL is always kept as the starting point and its `changedFromPrevious` column stays empty. A changed hash means the stored bytes differ - a new advert or a rotated banner counts as a change, so treat the column as \"worth looking at\", not as an editorial diff.",
            "default": false
          },
          "newestFirst": {
            "title": "Newest captures first",
            "type": "boolean",
            "description": "The archive's index is ordered oldest first, which is what you want for \"when did this page appear\" questions. Switch this on and the run asks for the end of the history instead, so a small row cap shows the most recent captures - the usual choice for monitoring and for checking whether a live page is archived at all.",
            "default": false
          },
          "maxItemsPerUrl": {
            "title": "At most this many rows per URL",
            "minimum": 1,
            "maximum": 2000,
            "type": "number",
            "description": "Keeps one heavily archived address in a list of twenty from eating the whole run. The cap is sent to the archive with the query, so a thin URL costs one request either way.",
            "default": 25
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 2000,
            "type": "number",
            "description": "Hard cap on the rows this run writes, and therefore on what it costs. The run stops as soon as it is reached and says so in its status message. The archive's index hands out at most about 10000 rows for one query, so a whole-domain export is done in slices - by year with `Captures from` / `Captures up to`, or by path.",
            "default": 50
          },
          "fields": {
            "title": "Only these columns",
            "type": "array",
            "description": "Keep only the named columns, in the order given - for example `originalUrl, capturedAt, rawUrl`. Empty = every column. `queryUrl`, `originalUrl`, `found`, `sourceMode`, `url` and `fetchedAt` are always present; name one of them here and it moves to the position you gave it. Unknown names are reported in the status message instead of being dropped in silence.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}