{"id":2356,"library":"waybackpy","title":"Waybackpy","description":"Waybackpy is a Python package and command-line tool that interfaces with the Internet Archive's Wayback Machine APIs. It provides functionalities to archive web pages and retrieve various archived versions easily. The library is actively maintained, with the current version being 3.0.6, and has a consistent release cadence.","status":"active","version":"3.0.6","language":"en","source_language":"en","source_url":"https://github.com/akamhy/waybackpy","tags":["web archiving","Internet Archive","Wayback Machine","API client"],"install":[{"cmd":"pip install waybackpy","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Used for making HTTP requests to the Wayback Machine APIs.","package":"requests","optional":false}],"imports":[{"note":"Recommended class for saving URLs to the Wayback Machine.","symbol":"WaybackMachineSaveAPI","correct":"from waybackpy import WaybackMachineSaveAPI"},{"note":"Recommended class for interacting with the CDX Server API to retrieve snapshots.","symbol":"WaybackMachineCDXServerAPI","correct":"from waybackpy import WaybackMachineCDXServerAPI"},{"note":"The 'Url' class is still supported but the specialized API classes (e.g., WaybackMachineSaveAPI) are recommended for new development since v3.0.0. Older versions might directly expose functions like `waybackpy.save()` without explicit class instantiation.","wrong":"import waybackpy.Url","symbol":"Url","correct":"from waybackpy import Url"}],"quickstart":{"code":"import os\nfrom waybackpy import WaybackMachineSaveAPI\n\nurl = \"https://www.example.com\"\n# Use a descriptive User-Agent for better API interaction\nuser_agent = os.environ.get('WAYBACKPY_USER_AGENT', 'MyCustomApp (https://mycustomapp.com)')\n\nsave_api = WaybackMachineSaveAPI(url, user_agent)\ntry:\n    archive_url = save_api.save()\n    print(f\"Page archived successfully: {archive_url}\")\nexcept Exception as e:\n    print(f\"Error archiving page: {e}\")","lang":"python","description":"Demonstrates how to use the `WaybackMachineSaveAPI` to save a URL to the Internet Archive's Wayback Machine. A descriptive User-Agent is highly recommended."},"warnings":[{"fix":"Upgrade to Python 3.6 or newer.","message":"Python 3.5 and older are no longer supported. Version 3.0.3 dropped support for Python 3.4-3.6, though Python 3.6 support was later restored in version 3.0.5. The library now explicitly requires Python >= 3.6.","severity":"breaking","affected_versions":">=3.0.3, <3.0.5 for Python 3.6; >=3.0.3 for Python 3.5 and below"},{"fix":"For retrieving archived page content, use the appropriate methods within the `WaybackMachineCDXServerAPI` or `Url` class for finding an archive, and then an HTTP client (like `requests`) to fetch the content from the returned archive URL.","message":"The `get()` method, which was previously used to retrieve the source code of a webpage, was deprecated in version 3.0.0. This method was considered a poor fit for the library's scope.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Refactor code to use the specific API classes (e.g., `WaybackMachineSaveAPI` for saving, `WaybackMachineCDXServerAPI` for CDX queries) instead of relying solely on the generic `Url` class.","message":"Starting from version 3.0.0, Waybackpy introduced dedicated classes for each of the three main Wayback Machine APIs: `WaybackMachineSaveAPI`, `WaybackMachineCDXServerAPI`, and `WaybackMachineAvailabilityAPI`. While the older `Url` class remains functional for backward compatibility, new development should leverage these specialized classes for better clarity and access to specific API features.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Prefer `WaybackMachineCDXServerAPI` for checking archive availability and retrieving archive metadata.","message":"The Internet Archive recommends against using the `WaybackMachineAvailabilityAPI` due to potential performance issues. Its functionality is largely covered by the `WaybackMachineCDXServerAPI`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}