get_archived_page
Retrieve archived webpage content from the Wayback Machine using a specific timestamp to access historical website versions and data.
Instructions
Retrieve content of an archived webpage from the Wayback Machine using YYYYMMDDHHMMSS timestamp. If original=true, request id_ mode.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| original | No | ||
| timestamp | Yes | ||
| url | Yes |
Implementation Reference
- wayback_mcp/server.py:133-159 (handler)Implements the core logic for retrieving an archived webpage from the Wayback Machine. Constructs the archived URL based on timestamp and optional 'original' mode, fetches the response using _fetch_text helper, and returns structured data including status, headers, and page text.async def get_archived_page( url: str, timestamp: str, original: bool = False, ) -> Dict[str, Any]: """ Fetch the archived page content. Returns status, headers, and text content. If `original` is True, uses the `id_` mode to minimize Wayback rewriting/banners. """ mode = "id_/" if original else "" archived_url = f"{WAYBACK_ENDPOINT}/{timestamp}/{mode}{url}" resp = await _fetch_text(archived_url) text: Optional[str] try: text = resp.text except Exception: text = None return { "url": url, "timestamp": timestamp, "archived_url": archived_url, "status_code": resp.status_code, "headers": dict(resp.headers), "text": text, }
- wayback_mcp/server.py:126-132 (registration)Registers the 'get_archived_page' tool with the FastMCP app, specifying the name and description.@app.tool( name="get_archived_page", description=( "Retrieve content of an archived webpage from the Wayback Machine " "using YYYYMMDDHHMMSS timestamp. If original=true, request id_ mode." ), )