{"id":10209,"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.","status":"active","version":"1.3.1","language":"en","source_language":"en","source_url":"https://github.com/palewire/savepagenow","tags":["archive","web-archive","internet-archive","web-scraping","api-wrapper"],"install":[{"cmd":"pip install savepagenow","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for making HTTP requests to the Internet Archive's API.","package":"requests"}],"imports":[{"note":"The primary function `save_page_now` is directly available in the top-level package namespace.","wrong":"import savepagenow.save_page_now","symbol":"save_page_now","correct":"from savepagenow import save_page_now"}],"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."},"warnings":[{"fix":"Implement delays or exponential backoff between requests, especially when processing multiple URLs. Check the `savepagenow` README for the most current advice on rate limits.","message":"The Internet Archive's 'Save Page Now' service has implemented rate limits. Exceeding these limits will result in HTTP 429 (Too Many Requests) errors. Rapid, consecutive requests should be avoided or spaced out.","severity":"gotcha","affected_versions":"1.3.1+"},{"fix":"Ensure you have valid `WAYBACK_ACCESS_KEY` and `WAYBACK_SECRET_KEY` set as environment variables or passed directly as `auth_key` and `auth_secret` arguments to `save_page_now`.","message":"Authentication is required for certain types of captures, particularly private ones. If you receive 401 Unauthorized or 403 Forbidden errors, it likely means your API keys are missing or invalid, or you lack the necessary permissions.","severity":"gotcha","affected_versions":"1.3.0+"},{"fix":"Implement robust error handling around your calls to `save_page_now`, including retries with delays for transient network or service errors.","message":"The Internet Archive's 'Save Page Now' service can sometimes be slow or temporarily unavailable. While `savepagenow` handles network requests, failures might occur due to upstream service issues.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Reduce the frequency of your requests. Add delays between calls to `save_page_now` or implement an exponential backoff strategy.","cause":"You have exceeded the Internet Archive's rate limit for the Save Page Now service.","error":"requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://web.archive.org/save/"},{"fix":"Ensure that `WAYBACK_ACCESS_KEY` and `WAYBACK_SECRET_KEY` environment variables are correctly set, or that `auth_key` and `auth_secret` arguments are passed with valid credentials to `save_page_now`.","cause":"Your provided authentication credentials (API key/secret) are missing or invalid.","error":"requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://web.archive.org/save/"},{"fix":"Use the correct import statement: `from savepagenow import save_page_now`. The main function is directly in the top-level package.","cause":"Typo in the import statement or trying to import a non-existent symbol.","error":"ImportError: cannot import name 'save_page_now' from 'savepagenow'"},{"fix":"Check your internet connection. For intermittent issues, retry the request after a short delay. Consider implementing retry logic in your application.","cause":"A network connectivity issue occurred, either on your end, between you and the Internet Archive, or on the Internet Archive's server.","error":"requests.exceptions.ConnectionError: ('Connection aborted.', RemoteHostClosedError('Remote host closed the connection without notice'))"}]}