Get archive link from the Wayback Machine

Please note: The tweaked version of this extension is available from the extension directory: Wayback Machine — PopClip Extensions

The following extension checks if an archived version of a website is available from the Wayback Machine (Wikipedia: Wayback Machine) which is run by the Internet Archive.

It copies the URL of the most recent archived version to the clipboard. The extension calls the Wayback Machine API, which is faster than other methods.

If the output URL is also to be displayed by PopClip, remove // before popclip.showText.

When holding the option key while envoking the extension, the returned URL is also opened in the browser. This makes it easier to check whether the archive version contains the desired content.

Rarely does the API incorrectly state that there is no archive version. In this case, this should be checked via Wayback Machine website.




// #popclip
// name: Wayback Machine
// icon: iconify:simple-icons:internetarchive
// language: javascript
// entitlements: [network]
// after: show-status

const axios = require('axios');

// extract and encode URL from popclip.input.text

const targetURL = encodeURIComponent(popclip.input.text);

// Wayback Machine APIs:
// define the Wayback Machine API URL with the target URL as query parameter

const waybackMachineApiUrl = `${targetURL}`;

// check Wayback Machine for the URL

async function checkWaybackMachine(url) {
  try {
    // GET request to the Wayback Machine API
    const response = await axios.get(url);
    const { archived_snapshots } =;

    // check if a closest is snapshot available
    if (archived_snapshots.closest && archived_snapshots.closest.available) {

      // if snapshot available, show success message, copy URL to clipboard
      // if snapshot available, show its details
      // popclip.showText(`Snapshot found: ${archived_snapshots.closest.url}`);

      // open archive URL in browser when option key is pressed
      if (popclip.modifiers.option) {

    } else {
      popclip.showText('No snapshot available for this URL.');
  } catch (error) {
    popclip.showText(`Error: ${error.message}`);

// Call the function with the Wayback Machine API URL

(The above block is an extension snippet – select it to install the extension with PopClip)



May I add this to the Extensions Directory?

Of course :smiley:

1 Like

Thank you. Here is is: Wayback Machine — PopClip Extensions

I tweaked it slightly to require a url as input using the requirements key.

1 Like

I used it to find this :smiley:


Hi, this release doesn’t work for me:

1 Like

Whoops! Try downloading again now (version 148)


Yess fantastic, thanks!

1 Like

The extension is currently not working due to a DDOS attack on the Internet Archive.

I hope it wasn’t all the PopClip users :wink:

1 Like