{
  "openapi": "3.0.1",
  "info": {
    "title": "Wayback Machine Scraper: Archived Snapshots & Pages",
    "description": "List Internet Archive Wayback Machine snapshots for URLs or whole domains (date range, status, MIME, collapse by change/day/URL), get the closest capture to a date, and optionally download archived page text or HTML. From $0.20 per 1,000 snapshots.",
    "version": "0.2",
    "x-build-id": "d5cqgjju2xFOiHrg8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidyharvest~wayback-machine-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidyharvest-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/tidyharvest~wayback-machine-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tidyharvest-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/tidyharvest~wayback-machine-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tidyharvest-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs or domains",
            "type": "array",
            "description": "One per line: a page URL (`https://example.com/pricing`) or a domain (`example.com`). With *Match type* = prefix/host/domain, every archived URL under it is listed.",
            "items": {
              "type": "string"
            }
          },
          "matchType": {
            "title": "Match type",
            "enum": [
              "exact",
              "prefix",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "Which archived URLs count as a match. Use *domain* with *Collapse = url* to list every page ever archived on a site (find deleted pages).",
            "default": "exact"
          },
          "from": {
            "title": "From date",
            "type": "string",
            "description": "Only captures on or after this date: `YYYY`, `YYYY-MM` or `YYYY-MM-DD`."
          },
          "to": {
            "title": "To date",
            "type": "string",
            "description": "Only captures on or before this date: `YYYY`, `YYYY-MM` or `YYYY-MM-DD`."
          },
          "collapse": {
            "title": "Collapse (de-duplicate)",
            "enum": [
              "none",
              "digest",
              "hour",
              "day",
              "month",
              "year",
              "url"
            ],
            "type": "string",
            "description": "Keep only the first capture per group. *Content changed* returns only captures whose content differs from the previous one: ideal for change history and price tracking.",
            "default": "none"
          },
          "statusCodes": {
            "title": "HTTP status filter",
            "type": "array",
            "description": "Keep only captures with these original HTTP statuses, e.g. `200`, `301`, `404`, or `2xx`. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "mimeType": {
            "title": "MIME type filter",
            "type": "string",
            "description": "Keep only this content type, e.g. `text/html`, `application/pdf`, `image/*`. Empty = all."
          },
          "urlRegex": {
            "title": "URL regex filter",
            "type": "string",
            "description": "Keep only archived URLs matching this regular expression (whole URL), e.g. `.*/product/.*`. Useful with prefix/domain match."
          },
          "newestFirst": {
            "title": "Newest first",
            "type": "boolean",
            "description": "Return the most recent captures first (with a cap, you get the latest N instead of the oldest N).",
            "default": false
          },
          "closestTo": {
            "title": "Closest snapshot to date",
            "type": "string",
            "description": "Instead of listing, return the ONE capture of each URL closest to this date (`YYYY-MM-DD`). Uses the Wayback availability API."
          },
          "fetchContent": {
            "title": "Fetch archived page content",
            "type": "boolean",
            "description": "Download the archived page for captures with status 200 (original bytes, no Wayback toolbar) and add `content`, `title`, `metaDescription`. Charged per page fetched.",
            "default": false
          },
          "maxPagesFetched": {
            "title": "Max pages to fetch",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on archived pages downloaded in the whole run (only with *Fetch content*).",
            "default": 10
          },
          "contentFormat": {
            "title": "Content format",
            "enum": [
              "text",
              "html"
            ],
            "type": "string",
            "description": "Plain text (scripts/styles removed) or the raw archived HTML.",
            "default": "text"
          },
          "maxContentChars": {
            "title": "Max characters per page",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate each page's content to this many characters. 0 = no limit.",
            "default": 100000
          },
          "maxSnapshotsPerUrl": {
            "title": "Max snapshots per URL",
            "minimum": 0,
            "type": "integer",
            "description": "0 or empty = no limit."
          },
          "maxItems": {
            "title": "Max snapshots in total",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on results for the whole run (also caps your cost), shared fairly between your URLs: each gets an equal share and URLs with fewer captures pass the rest on. 0 = no limit.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}