SDKs overview
SavePage.io provides Software Development Kits (SDKs) and client libraries designed to facilitate programmatic interaction with its web archiving API. These tools abstract the underlying HTTP requests and authentication mechanisms, allowing developers to integrate website capture and management capabilities directly into their applications using familiar programming languages. The primary function of these SDKs is to simplify the process of requesting page captures and retrieving results, including handling asynchronous operations via webhooks or polling.
The core functionality exposed through the SDKs includes initiating new web page captures, checking the status of ongoing captures, and accessing the archived content or metadata. For example, a developer might use an SDK to automate the capture of specific web pages at regular intervals for compliance purposes or to collect historical data for analysis. The API supports various capture options, such as full-page screenshots, PDF conversions, and MHTML archives, which can be specified through the SDKs' method parameters, as detailed in the SavePage.io API reference documentation.
Beyond the official SDKs, the developer community has also contributed libraries that extend support to other languages or provide specialized integrations. These community-driven efforts can offer alternative approaches or cater to niche requirements not directly addressed by the official tools. When choosing an SDK or library, developers typically consider factors such as language compatibility, feature completeness, and the level of ongoing support, whether from official channels or the community.
Official SDKs by language
SavePage.io offers official SDKs for several popular programming languages, each designed to provide a native development experience. These SDKs are maintained by SavePage.io and are the recommended method for integrating with the API. They typically include features such as request serialization, response deserialization, error handling, and authentication management, reducing the boilerplate code developers need to write.
The table below outlines the official SDKs, their respective package managers, and typical installation commands. Each SDK is designed to align with the official SavePage.io documentation and API specifications, ensuring consistency and reliability in interactions.
| Language | Package Manager | Install Command | Maturity |
|---|---|---|---|
| Python | pip | pip install savepage-python |
Stable |
| Node.js | npm | npm install @savepage/node |
Stable |
| Go | go get | go get github.com/savepage/go-sdk |
Stable |
| PHP | Composer | composer require savepage/php-sdk |
Stable |
These SDKs are continuously updated to reflect new API features and improvements. Developers are encouraged to refer to the specific SDK's documentation on GitHub or within the main SavePage.io developer documentation for the most current usage instructions and release notes.
Installation
Installing the SavePage.io SDKs is generally straightforward, following the standard practices for each language's package management system. Prior to installation, ensure that your development environment has the necessary language runtime and package manager installed.
Python SDK Installation
The Python SDK is distributed via PyPI. To install it, open your terminal or command prompt and execute the following command:
pip install savepage-python
It's recommended to install SDKs within a virtual environment to manage dependencies effectively. Further details on Python package management can be found in the Python venv documentation.
Node.js SDK Installation
For Node.js projects, the SDK is available through npm. Navigate to your project directory in the terminal and run:
npm install @savepage/node
This command adds the @savepage/node package to your node_modules directory and updates your package.json file. For Yarn users, the command would be yarn add @savepage/node.
Go SDK Installation
Go modules are used to manage dependencies for the Go SDK. To fetch the module, use:
go get github.com/savepage/go-sdk
After executing this, your go.mod file will be updated, and the package will be available for use in your Go project. Ensure your Go environment is properly configured, as described in the Go Modules reference.
PHP SDK Installation
The PHP SDK relies on Composer, the dependency manager for PHP. From your project's root directory, execute:
composer require savepage/php-sdk
This command will download the SDK and its dependencies into your vendor/ directory and generate the autoloader file. If you don't have Composer installed, refer to the Composer documentation for installation instructions.
Quickstart example
This section provides a basic quickstart example using the Python SDK to initiate a web page capture. The example demonstrates authenticating with your API key, specifying the URL to capture, and handling the initial response. For full details on all available parameters and error handling, consult the SavePage.io API reference.
Python Quickstart
First, ensure you have your SavePage.io API key. You can find this in your SavePage.io account dashboard. Replace 'YOUR_API_KEY' with your actual key.
import os
from savepage import SavePageClient
# Initialize the client with your API key
# It's recommended to use environment variables for sensitive data
api_key = os.environ.get('SAVE_PAGE_API_KEY', 'YOUR_API_KEY')
client = SavePageClient(api_key=api_key)
# Define the URL to capture
url_to_capture = 'https://example.com/page-to-archive'
try:
# Initiate the capture
# The 'capture' method returns a Capture object with details like 'capture_id'
capture_response = client.capture(url=url_to_capture, format='png', callback_url='https://your-app.com/webhook/savepage')
print(f"Capture initiated successfully for URL: {url_to_capture}")
print(f"Capture ID: {capture_response.capture_id}")
print(f"Status URL: {capture_response.status_url}")
print(f"Initial Status: {capture_response.status}")
# To get the final result, you would typically wait for the webhook callback
# or poll the status_url using client.get_capture_status(capture_response.capture_id)
except Exception as e:
print(f"An error occurred during capture: {e}")
This Python snippet demonstrates how to create a client instance, request a capture for a specific URL, and print the initial response. The callback_url parameter is crucial for receiving asynchronous notifications when the capture process is complete, which is a common pattern for long-running operations in web APIs, as discussed in Twilio's webhook security guide. Developers would typically set up a webhook endpoint in their application to process these callbacks and retrieve the final archived content or its URL.
Node.js Quickstart
const { SavePageClient } = require('@savepage/node');
// Initialize the client with your API key
const client = new SavePageClient(process.env.SAVE_PAGE_API_KEY || 'YOUR_API_KEY');
const urlToCapture = 'https://example.com/another-page';
async function initiateCapture() {
try {
const captureResponse = await client.capture({
url: urlToCapture,
format: 'pdf',
callbackUrl: 'https://your-app.com/webhook/savepage-nodejs'
});
console.log(`Capture initiated for URL: ${urlToCapture}`);
console.log(`Capture ID: ${captureResponse.captureId}`);
console.log(`Status URL: ${captureResponse.statusUrl}`);
console.log(`Initial Status: ${captureResponse.status}`);
} catch (error) {
console.error(`Error during capture: ${error.message}`);
}
}
initiateCapture();
The Node.js example follows a similar structure, using asynchronous JavaScript to handle the API call. It's good practice to manage API keys securely using environment variables rather than hardcoding them directly into the source code.
Community libraries
While SavePage.io maintains official SDKs for key languages, the open-source community may develop and maintain additional libraries that extend functionality or support other programming environments. These community contributions can fill gaps in official support, offer alternative feature sets, or provide integrations with specific frameworks or tools. Community libraries are typically hosted on platforms like GitHub and may vary in terms of maturity, documentation quality, and ongoing maintenance.
As of 2026, the primary focus for SavePage.io integration remains on its official SDKs. However, developers are encouraged to explore community resources by searching GitHub or relevant package repositories for savepage.io clients or integrations in their preferred language. When considering a community library, it is advisable to check the project's activity, issue tracker, and contributor base to assess its reliability and future support. For example, some developers might create wrappers for less common languages or specialized command-line tools that leverage the SavePage.io API.
The SavePage.io team occasionally highlights popular community projects through its documentation or blog, but official support and guarantees are generally reserved for the SDKs listed under Official SDKs by language. Developers contributing to or using community libraries are a valuable part of the SavePage.io ecosystem, fostering broader adoption and innovative uses of the API.