Download the PHP package inwebo/save-page-now-2 without Composer
On this page you can find all versions of the php package inwebo/save-page-now-2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inwebo/save-page-now-2
More information about inwebo/save-page-now-2
Files in inwebo/save-page-now-2
Package save-page-now-2
Short Description Capture a web page as it appears now for use as a trusted citation in the future.
License MIT
Homepage https://github.com/inwebo/save-page-now-2
Informations about the package save-page-now-2
save-page-now-2
PHP 8.1+ client library for the Save Page Now 2 (SPN2) API provided by the Internet Archive.
Official Documentation
- Google Doc (Vangelis Banos, Internet Archive) ← Most comprehensive reference
- Readable Mirror Gist
Installation
Obtain your S3 API keys at https://archive.org/account/s3.php.
Quick Start
Architecture
Complete API
capture(string $url, ?CaptureOptions $options = null): CaptureJobResponse
Submits a URL for archiving. Returns a job_id immediately.
getStatus(string $jobId): StatusResponseInterface
Returns a PendingStatusResponse, SuccessStatusResponse, or ErrorStatusResponse.
getStatuses(array $jobIds): array<string, StatusResponseInterface>
Retrieves the status of multiple jobs in a single request.
getOutlinksStatus(string $parentJobId): array<string, StatusResponseInterface>
Retrieves the status of all outlinks for a parent job (requires capture_outlinks=1).
getUserStatus(): UserStatusResponse
Active and available sessions for the authenticated user.
getSystemStatus(): SystemStatusResponse
Overall health of the SPN2 service.
Capture Options
| Builder method | API Parameter | Description |
|---|---|---|
withCaptureAll() |
capture_all=1 |
Also captures 4xx/5xx pages |
withCaptureOutlinks() |
capture_outlinks=1 |
Automatically archives outlinks |
withCaptureScreenshot() |
capture_screenshot=1 |
Captures a full-page PNG screenshot |
withDelayWbAvailability() |
delay_wb_availability=1 |
Available in \~12h (reduces server load) |
withForceGet() |
force_get=1 |
Forces a simple GET (no headless browser) |
withSkipFirstArchive() |
skip_first_archive=1 |
Skips the "first archive" check (faster) |
withIfNotArchivedWithin(string) |
if_not_archived_within |
Only archives if older than e.g., "3d 5h" |
withOutlinksAvailability() |
outlinks_availability=1 |
Returns the last snapshot timestamp for each outlink |
withEmailResult() |
email_result=1 |
Sends an email report |
withJsBehaviorTimeout(int $s) |
js_behavior_timeout=N |
JS execution time after loading (0–30s) |
withCaptureCookie(string) |
capture_cookie |
Additional HTTP cookie for the target |
withTargetCredentials(string, string) |
target_username/password |
Credentials for the target's auth forms |
Error Handling
Detailed error codes from status_ext (e.g., error:not-found, error:too-many-daily-captures) are available via ErrorStatusResponse::getStatusExt().
Testing
Run tests using the included PHPUnit runner:
License
MIT