{
  "openapi": "3.0.1",
  "info": {
    "title": "Wayback Machine Scraper: Snapshots, History & Old URLs",
    "description": "Get the Wayback Machine history of any URL or domain from archive.org's official CDX API: first and last capture, last working copy, status changes, content versions, every snapshot, and all historical URLs of a domain (for SEO recovery and due diligence).",
    "version": "0.1",
    "x-build-id": "qcGtZl2pUM3u9axxc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/latamdatatools~wayback-machine-history/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-latamdatatools-wayback-machine-history",
        "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/latamdatatools~wayback-machine-history/runs": {
      "post": {
        "operationId": "runs-sync-latamdatatools-wayback-machine-history",
        "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/latamdatatools~wayback-machine-history/run-sync": {
      "post": {
        "operationId": "run-sync-latamdatatools-wayback-machine-history",
        "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": {
          "mode": {
            "title": "What to get",
            "enum": [
              "summary",
              "snapshots",
              "domainUrls"
            ],
            "type": "string",
            "description": "History summary: one row per URL with first and last capture, last working capture, status changes, number of versions and captures per year. Snapshots: every capture of each URL. Historical URLs of a domain: every URL the Wayback Machine ever saw on the domain.",
            "default": "summary"
          },
          "urls": {
            "title": "URLs or domains",
            "type": "array",
            "description": "One per line: a page URL (example.com/pricing) or a domain (example.com). http/https does not matter: the Wayback index ignores it.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset (from another Actor run)",
            "type": "string",
            "description": "Optional: read the URLs from an Apify dataset (field set in \"URL field\")."
          },
          "csvUrl": {
            "title": "CSV file URL",
            "type": "string",
            "description": "Optional: public CSV with a header row (or one URL per line). Google Sheets links work if shared as \"Anyone with the link\"."
          },
          "urlField": {
            "title": "URL field",
            "type": "string",
            "description": "Field / column with the URL or domain.",
            "default": "url"
          },
          "from": {
            "title": "From date",
            "type": "string",
            "description": "Optional: YYYY, YYYY-MM or YYYY-MM-DD."
          },
          "to": {
            "title": "To date",
            "type": "string",
            "description": "Optional: YYYY, YYYY-MM or YYYY-MM-DD."
          },
          "statusCodes": {
            "title": "HTTP status filter",
            "type": "array",
            "description": "Optional: keep only captures with these statuses, e.g. 200, 3xx. Prefix with ! to exclude: !404.",
            "items": {
              "type": "string"
            }
          },
          "mimeTypes": {
            "title": "MIME type filter",
            "type": "array",
            "description": "Optional: e.g. text/html (only pages), application/pdf. * works as a wildcard: image/*.",
            "items": {
              "type": "string"
            }
          },
          "collapse": {
            "title": "Snapshots: collapse",
            "enum": [
              "none",
              "contentChange",
              "day",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Snapshots mode only. Content changes = skip consecutive captures with identical content (the most useful to see when a page changed).",
            "default": "none"
          },
          "domainMatch": {
            "title": "Historical URLs: scope",
            "enum": [
              "domain",
              "host",
              "prefix"
            ],
            "type": "string",
            "description": "Historical URLs mode only. Domain = the domain and all subdomains; Host = only that exact host; Prefix = only URLs that start with the given URL (e.g. example.com/blog/).",
            "default": "domain"
          },
          "skipUrlsWithParameters": {
            "title": "Historical URLs: skip URLs with ?parameters",
            "type": "boolean",
            "description": "Historical URLs mode only. On: leave out URLs with a query string (tracking parameters, session IDs, search pages), which are usually noise. Turn off to keep them (e.g. old ?p=123 links).",
            "default": true
          },
          "maxResultsPerUrl": {
            "title": "Max results per URL / domain",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Snapshots or historical URLs returned per input (not used in summary mode).",
            "default": 1000
          },
          "maxUrls": {
            "title": "Max URLs / domains per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Inputs beyond this number are ignored.",
            "default": 1000
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since the last run",
            "type": "boolean",
            "description": "Snapshots and historical URLs modes: remember what was already returned (named key-value store \"wayback-history-state\") and only return new captures / newly seen URLs. Good for scheduled runs.",
            "default": false
          },
          "delayBetweenRequestsMs": {
            "title": "Delay between requests to archive.org (ms)",
            "minimum": 2000,
            "maximum": 30000,
            "type": "integer",
            "description": "archive.org is a non-profit with rate limits. Requests are sent one at a time with this delay; on HTTP 429 the Actor waits and, if it repeats, stops cleanly.",
            "default": 4000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}