{"library":"savepagenow","title":"savepagenow","description":"savepagenow is a simple Python wrapper and command-line interface for archive.org’s 'Save Page Now' capturing service. It allows users to programmatically request that the Internet Archive save a specific URL. The library is currently at version 1.3.1 and maintains an active release cadence, primarily with dependency updates and important feature additions like authentication and rate limit documentation.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install savepagenow"],"cli":{"name":"savepagenow","version":"Usage: savepagenow [OPTIONS] URL"}},"imports":["from savepagenow import save_page_now"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom savepagenow import save_page_now\n\n# Replace with the URL you want to archive\nurl_to_archive = \"https://example.com/\"\n\n# Optional: Set authentication credentials via environment variables or direct arguments\n# If you don't set these, captures will be public (if supported by IA)\n# For private captures, you'll need a Wayback Machine access key and secret.\n# WAYBACK_ACCESS_KEY='YOUR_ACCESS_KEY'\n# WAYBACK_SECRET_KEY='YOUR_SECRET_KEY'\n\n# Example using environment variables (recommended)\naccess_key = os.environ.get('WAYBACK_ACCESS_KEY', '')\nsecret_key = os.environ.get('WAYBACK_SECRET_KEY', '')\n\ntry:\n    if access_key and secret_key:\n        print(f\"Attempting to save {url_to_archive} with authentication...\")\n        archive = save_page_now(\n            url_to_archive,\n            auth_key=access_key,\n            auth_secret=secret_key\n        )\n    else:\n        print(f\"Attempting to save {url_to_archive} without authentication...\")\n        archive = save_page_now(url_to_archive)\n\n    if archive.get('archive_url'):\n        print(f\"Page saved successfully: {archive['archive_url']}\")\n    else:\n        print(f\"Failed to save page. Response: {archive}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to use `savepagenow` to archive a URL. It includes an example of how to optionally pass authentication credentials, which are required for private captures. It's recommended to set `WAYBACK_ACCESS_KEY` and `WAYBACK_SECRET_KEY` environment variables for authenticated use.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}