{
  "openapi": "3.0.1",
  "info": {
    "title": "Wayback Machine Site History: Snapshots & First Seen",
    "description": "Look up any domain or URL in the Internet Archive's Wayback Machine via the official CDX API. Get every archived snapshot (date, status, MIME type, digest, archive link) or a history summary: first and last seen, snapshot count, pages, versions, captures per year. Errors are free.",
    "version": "0.1",
    "x-build-id": "Kk6y8nYyIl0uy8xyo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fjordlabs~wayback-history/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fjordlabs-wayback-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/fjordlabs~wayback-history/runs": {
      "post": {
        "operationId": "runs-sync-fjordlabs-wayback-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/fjordlabs~wayback-history/run-sync": {
      "post": {
        "operationId": "run-sync-fjordlabs-wayback-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Domains or URLs",
            "type": "array",
            "description": "Websites or pages to look up in the Wayback Machine, one per line: apify.com, https://apify.com/store, example.com/blog/* (prefix) or *.example.com (all subdomains). Wildcards override 'Match type' for that line.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Output",
            "enum": [
              "snapshots",
              "summary",
              "both",
              "closest"
            ],
            "type": "string",
            "description": "Snapshots: one row per archived capture. Summary: one history row per input (first/last seen, snapshot count, distinct pages and versions, captures per year). Both: snapshots and a summary. Closest: the one capture nearest to 'Closest to date' per URL.",
            "default": "snapshots"
          },
          "matchType": {
            "title": "Match type",
            "enum": [
              "exact",
              "prefix",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "exact: only this URL. prefix: every URL that starts with it (a folder like /blog/). host: every page on this host name. domain: the host and all its subdomains. Host and domain queries on big sites are slow on archive.org's side; use dates and filters to narrow them.",
            "default": "exact"
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Only captures on or after this date: YYYY, YYYY-MM, YYYY-MM-DD, YYYYMMDDhhmmss, or a period like '30 days', '6 months', '5 years'."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Only captures up to and including this date (same formats). '2020' includes all of 2020."
          },
          "collapse": {
            "title": "Collapse",
            "enum": [
              "none",
              "digest",
              "hour",
              "day",
              "month",
              "year",
              "urlkey"
            ],
            "type": "string",
            "description": "Thin out the results. Content changes: skip captures whose content is identical to the previous one (same digest). Per hour/day/month/year: at most one capture per URL per period. One per URL: list every distinct archived URL once (great with host/domain match).",
            "default": "none"
          },
          "statusFilter": {
            "title": "HTTP status",
            "enum": [
              "any",
              "200",
              "2xx",
              "3xx",
              "4xx",
              "5xx",
              "not-revisit"
            ],
            "type": "string",
            "description": "Keep only captures with this HTTP status. 'Any except revisits' drops the duplicate 'warc/revisit' records.",
            "default": "any"
          },
          "mimeTypeFilter": {
            "title": "Content type",
            "enum": [
              "any",
              "html",
              "pdf",
              "images",
              "json",
              "css",
              "javascript",
              "xml"
            ],
            "type": "string",
            "description": "Keep only captures of this type.",
            "default": "any"
          },
          "customFilters": {
            "title": "Custom CDX filters (advanced)",
            "type": "array",
            "description": "Extra filters in the CDX server's syntax [!][~]field:regex, field = urlkey, timestamp, original, mimetype, statuscode, digest or length. Examples: '!statuscode:404', 'original:.*\\.pdf$'. All filters must match.",
            "items": {
              "type": "string"
            }
          },
          "closestTo": {
            "title": "Closest to date (Closest mode)",
            "type": "string",
            "description": "For 'Closest snapshot to a date': the date to look around, e.g. 2020-01-01. Empty = now (the newest capture)."
          },
          "maxSnapshotsPerInput": {
            "title": "Max snapshots per input",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop listing snapshots for one domain/URL after this many rows. Each snapshot is one result row.",
            "default": 1000
          },
          "maxSnapshots": {
            "title": "Max snapshots (total)",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Stop after this many snapshot rows across all inputs.",
            "default": 10000
          },
          "maxCapturesPerSummary": {
            "title": "Max captures counted per summary",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "A summary reads the capture index (10,000 rows per request) up to this many captures. Popular sites have millions; the summary then says complete = false and its counts are lower bounds (for an exact URL, lastSeen is still exact). Counting is included in the summary price.",
            "default": 50000
          },
          "maxConcurrency": {
            "title": "Inputs in parallel",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many inputs to query at the same time (1–3). Requests to archive.org are spaced out politely either way.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}