archivetoday
Unofficial API and CLI for archive.today. Supports creating/fetching snapshots and listing all the snapshots of a URL.
API
/** * Sorted oldest to newest */; /** * Asks archive.today to create or return the latest snapshot for a given URL. * @throws If there is a captcha or if the input is invalid. */declare ;/** * Retrieves a listing of all snapshots of a given URL on archive.today */declare ;
Examples
; // cachedDate will be set if a previous snapshot is returned;// array of { url, date }; // Don't wait for the initial saving to finish (wip will be set if it's in progress)// cachedDate will be set if a previous snapshot is returned; // Attempts to create a new snapshot. cachedDate can still be set if a snapshot was very recently created (archive.today has a ratelimit per url of about an hour).; // Create a snapshot or force re-archival without waiting.; // Renew only if the snapshot is older than a week.;
CLI examples
This package also comes with a CLI, which is primarily useful when installing globally.
$ archivetoday example.com # Returns a snapshot link and the date $ archivetoday --renew example.com # Asks archive.today to create a new snapshot (aka -r) $ archivetoday --quiet example.com # Only returns the URL, useful for scripting (aka -q) $ archivetoday --incomplete example.com/notfound # Returns the archive link immediately without waiting for the process to complete. Especially useful with -q. (aka -c) $ archivetoday -rc example.com # Re-archive a link, without waiting (renew and incomplete) $ archivetoday timemap microsoft.com # Returns all archive links for a url
License
MIT